Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

PuppetMaster - Advanced Character Physics Tool [RELEASED]

Discussion in 'Assets and Asset Store' started by Partel-Lang, Oct 1, 2015.

  1. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    No idea, but.. when you select the Animator, do you see "handled by script"? where the rootmotion checkbox should be? If so, maybe there are 2 different scripts on it that use OnAnimatorMove? It's the only thing I can think of. If Animator is not on Animate Physics mode, PuppetMaster will not touch the Animator at all.

    Hey,
    Haven't tried Netcode, but there are getting started packages for the old Unet, Mirror and PUN1/2 in the Plugins/RootMotion/PuppetMaster/_Integration folder.

    Best,
    Pärtel
     
  2. retired_unity_saga

    retired_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    296
    hey, thanks again for this amazing plugin.

    I had a small question, I wish to use the puppetmaster ragdoll colliders generation for my rigs, but then remove the puppetmaster asset functionality as I am making my own custom version derived from your code. I am also using Final IK, and intend to have that on the rig as well, what is the best practice in utilizing the default imported version of your plugin puppetmaster to do this?

    basically, I am trying to preserve final IK rig, generate colliders to use with my custom version of your plugin, since it derives from the plugin but lives outside the folder i can update freely and worry less about breaking references.
     
  3. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    You'll need just these folders from PuppetMaster:
    upload_2024-3-15_12-34-40.png

    Shared Scripts folders are also included (and required by) Final IK.

    Best,
    Pärtel
     
    retired_unity_saga likes this.
  4. cajphrase

    cajphrase

    Joined:
    Apr 24, 2021
    Posts:
    12
    Hi Partel,

    Does Puppetmaster support the Unity Animation Rigging Package? I've got a spider type creature in my game that i've set up completely with procedural animation using the Animation Rigging package. I've just purchased Puppetmaster and after setting it up with my creature the visual mesh is contorted and doesn't match the ragdoll at all, even when I force the ragdoll in place using angular pinning.
     
  5. simonkingandaoking

    simonkingandaoking

    Joined:
    Dec 27, 2021
    Posts:
    21
    how to make it so that big weapons can swing and unpin the puppet more,cause big weapons cant be swung too quick,need to add some unpinning by script
     
  6. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    Animation Rigging is done with the Animator so for PuppetMaster it is the same as just normal animation. I think there must be something else wrong with the spider, but can't tell what it could be without more information. Could you perhaps send a unitypackage with your spider set up with PM so I could take a closer look here?

    Hey,

    Boosters can give your attacking puppet some more strength.

    Declare a public Booster booster;

    Can set it up in Editor to give some muscles or muscle groups immunity and/or temporary impulse multiplier (unpins other puppets more on collision). Then call booster.Boost(behaviourPuppet) when you start with the attack.

    Booster effect falls off over time, defined by "Boost Falloff" in BehaviourPuppet. Value of 1 means the effect will be gone in 1 second.

    Boosters are used in the "Melee" demo, you can find them if you expand the "Actions" in CharacterMeleeDemo component on the "Character Controller" gameobject.

    Best,
    Pärtel
     
  7. OmnifariousStudios

    OmnifariousStudios

    Joined:
    Mar 12, 2018
    Posts:
    50
    Hey Partel,

    I'm attempting to use an enemy with FBBIK and AimIK, like in the FBBIK Boxing demo. However they also use a full PuppetMaster rig.

    It's also a giant sized enemy, here's the scale.

    upload_2024-4-8_14-32-50.png

    This works really well, at first. Then I'm not sure what happens, but after a while the giant enemy starts to spin uncontrollably. The only way I can fix it is by completely weighing out AimIK, or by setting the Puppet to Kinematic.

    As far as I can tell, the only difference between your example and the giant enemy (besides the puppet) is that you have the AimIK as a child object of the animator and I have AimIK and FBBIK on the same object.

    Any ideas for what may be going wrong? Thanks!
     
  8. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey, sorry about the delay...
    Do you have "Fix Transforms" enabled in AimIK and "Fix Target Transforms" in PuppetMaster?
     
  9. OmnifariousStudios

    OmnifariousStudios

    Joined:
    Mar 12, 2018
    Posts:
    50
    Hey Partel!

    Yes, Fix Transforms is enabled on FBBIK, AimIK, and Fix Target Transforms is active on PuppetMaster. Should only one of these be active at a time?

    Also, new issue. I've been messing with giant size enemies, scaling up the ragdolls to 8-10x the normal scale. For the most part it works well, but when I attach a configurable joint from the giant ragdoll to something else (player can shoot webs) the ragdoll gets sent in the opposite direction with really large force until they're outside the map or the joint is destroyed. Any ideas here?
     
  10. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    When characters start rolling, it is usually some kind of a circular dependency issue like AimIK target parented to the root of the avatar and AimController turning the root to catch up with the target, so that also turns the target again, so it's like a dog chasing its tail.

    No idea about the configurable joint issue. Make sure you add it in FixedUpdate. If it explodes, maybe the anchors are calculated wrong or something like that. Could set X/Y/Z Motion to Free and use X/Y/Z Drive, smoothly increasing its spring over time to avoid a sudden snap and see where it tries to pull it to.

    Best,
    Pärtel
     
  11. simonkingandaoking

    simonkingandaoking

    Joined:
    Dec 27, 2021
    Posts:
    21
    thanks very much ,but i meant give player more strength,for example i want the player weapon to sent the enemie flying when at a certain speed or under a buff
     
  12. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,

    Hmm.. I see...
    Maybe make a script that listens to behaviourPuppet.OnCollision delegate:
    behaviourPuppet.OnCollision += ProcessCollision;
    That gets fired every time the puppet collides with something.

    in void ProcessCollision(MuscleCollision m) check if the colliding object is a big sword. If so, add some additional force to what it collided with in the point of contact and in the direction of m.collision.impulse.

    Best,
    Pärtel
     
  13. shaariqch

    shaariqch

    Joined:
    Oct 19, 2023
    Posts:
    5
    Hi Partel, firstly, love this amazing asset. Can't believe just how easy it is to setup and how well it works.

    I'm attempting to integreate it with fish networking. I used the mirror integration demo combined with third person controller demo and got something working. I just modified the mirror related scripts to use fishnet, easy enough. There's only one very odd thing I'm running into, i'll attach a video here for reference https://drive.google.com/file/d/12nuLpDgvjc-EN5wEXxgTl2THO_szztvS/view?usp=sharing

    Basically, at every point when the player is close to getting up, the rotation of the player seems to (for just ONE frame only) be wrong, and then it gets corrected again. The video I attached is frame-by-frame so you can see it clearly.

    one caveat is that I am using the prediction feature of fishnet.

    Happy to also package an example project to send over to you.
     
    Last edited: Apr 28, 2024
  14. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    Can't think of anything that would cause it, does it happen with the prediction feature off too? If you select the PuppetMaster gameobject and look at it in Scene View, do you see the colliders twitching like that too or is it just the skinned mesh? A repro project would make it a lot easier, thanks!

    Best,
    Pärtel
     
  15. shaariqch

    shaariqch

    Joined:
    Oct 19, 2023
    Posts:
    5
    Thanks for that Partel. I sort of figured it out/hacked it out where I created a custom behaviour puppet that basically does not update the position and rotation with
    MoveTarget() an RotateTarget() but instead delegate to the component where I do my prediction stuff, and it seems to be working okay.

    I'm running into another problem though. I use the `OnPostSimulate` and `OnPreSimulate` functions of puppetMaster.However this disables the animator, and that's kind of an issue because I need the animator enabled in order for animation rigging to work. Do you have any recommendations as to what I can do here?

    edit: it also affects animator IK. The built in IK pass and all that don’t seem to work either while the animator is disabled :(
     
    Last edited: May 5, 2024
  16. shaariqch

    shaariqch

    Joined:
    Oct 19, 2023
    Posts:
    5
    Hi @partel, any thoughts on the above? A little stuck here:(
     
  17. OmnifariousStudios

    OmnifariousStudios

    Joined:
    Mar 12, 2018
    Posts:
    50
    Hey Partel!

    So I'm working on adding moddable enemies to my game. Of course doing a full puppetmaster setup process at runtime would be really cpu intensive, and the colliders need to be adjusted for some enemies, so I've tried to offload as much of the work as I can to the modding SDK.

    How it works:
    1. Modder adds the model to the modding SDK.
    2. My SDK adds all necessary components (Rigidbodies, Colliders, and Character Joints) and makes it into the usual Root object + Character and Puppet children.
    3. SDK packs it into addressables and loads it into mod.io.
    4. Mod is loaded into the game and I go through the runtime PuppetMaster Setup process.

    The whole thing works, except that when the enemy is loaded into the game, the CharacterJoints are broken and very offset. I've tried using the function JointConverter.ToConfigurable() at runtime, but that doesn't fix it either.

    I think it would work if the modding SDK could set up the character with your BipedRagdollCreator script. Is there any part of that code that could be used in a public SDK? Or do you have any ideas on how to fix the joints/anchors?

    Thank you!
     
  18. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey, sorry for the long wait, had some traveling to do...

    Seems to be a solution here, have you tried that?

    Hey,
    Do you have "Update Joint Anchors" and "Support Translation Animation" enabled in PuppetMaster? With those PM recalculates joint anchors every frame so they should not be a problem. Also, for some reason Unity recalculates joint rest rotations every time their gameobjects are activated (and it's not possible to calculate them manually), so make sure the puppets are in their default pose every time you (re)activate them.

    Anyway, I wouldn't mind if you extracted BipedRagdollCreator and made use of it in your public SDK.

    Cheers,
    Pärtel
     
  19. shaariqch

    shaariqch

    Joined:
    Oct 19, 2023
    Posts:
    5
    Yes, no luck with that, I saw that post a little while ago.

    Quoting a snippet from the post you linked:
    so basically the animator needs to be enabled for that fix to work. To be honest I'm surprised this actually hasn't come up before with others. Do you have any other suggestions?
     
  20. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    It looks like a bug on Unity's side then. I can't enable the Animator because if I do so, it will update itself at the wrong time and break the animation-physics link. Only thing I can suggest is replace animation rigging stuff with something else that you can run from PuppetMaster.OnRead delegate (called by PM after animation and before reading the pose so that's where you can apply procedural animation from).

    Best,
    Pärtel
     
  21. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    46
    Hi Partel
    I am having an issue with dead puppets. Is it impossible to mark them as kinematic or disabled? Dead puppets are reverting back to active and I can't find the source of it on my end so I was just wondering if this is the normal functionality, thanks.
     
  22. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    Did you try setting state to Frozen instead of Dead? That will disable all physics after the ragdoll settles. Can't use Kinematic or Disabled modes while Dead because the ragdoll is active.

    Best,
    Pärtel
     
    hermitmode likes this.
  23. hermitmode

    hermitmode

    Joined:
    Sep 15, 2020
    Posts:
    46
    Thanks, will do.
     
  24. camerondus

    camerondus

    Joined:
    Dec 15, 2018
    Posts:
    63
    hi @Partel-Lang,

    we are having issues getting puppet master to work in unity 6. there have been optimizations (and bugs) related to ragdolls with unity 6 (highlighted in this forum post), though they seem to be fixed in 6000.0.4. however, we are still facing issues when using puppet master specifically. im thinking puppet master may need to be updated to be compatible with the new changes.. our issues start when going from the "disabled" or "kinematic" to "active" state.
     
    Last edited: Jun 2, 2024
  25. simonkingandaoking

    simonkingandaoking

    Joined:
    Dec 27, 2021
    Posts:
    21
    Hi Partel,been trying to get a stunned state for the puppets that disables the puppetmaster leaving only the collison,and use hit reaction instead when the stun animation is played,however when i reopen the puppetmaster ut falls over for some reason can i ask why,used some code i found in the forum you provided,changed it like this:
    private void Pause()
    {

    puppet.enabled = false;
    // puppet.puppetMaster.enabled = false;
    puppet.puppetMaster.mode=PuppetMaster.Mode.Kinematic;
    // puppet.puppetMaster.targetAnimator.enabled = false;
    foreach (Muscle m in puppet.puppetMaster.muscles)
    {
    m.rigidbody.isKinematic = true;
    }
    }

    private void Resume()
    {

    // puppet.puppetMaster.enabled = true;
    puppet.puppetMaster.mode=PuppetMaster.Mode.Active;
    puppet.enabled = true;

    foreach (Muscle m in puppet.puppetMaster.muscles)
    {
    m.rigidbody.velocity=Vector3.zero;
    m.rigidbody.isKinematic = false;
    m.rigidbody.AddForce(m.mappedVelocity, ForceMode.VelocityChange);
    m.rigidbody.AddTorque(m.mappedAngularVelocity, ForceMode.VelocityChange);
    }
    */
    }


    if i disable the ouppetmaster completely it doesnt fall down when enabled,however the cliders wont follow the animation anymore
     
  26. Partel-Lang

    Partel-Lang

    Joined:
    Jan 2, 2013
    Posts:
    2,567
    Hey,
    Thanks for the heads-up, just replied to that thread. I tried most of everything, but other than that half-solution I mentioned there, there's nothing I can do on PM's side, this really needs to be fixed by Unity and hopefully soon because currently we can say that Unity6 does not support ragdolls lol.

    Hey,
    Should work if you just keep BehaviourPuppet enabled. It needs to do some things in Kinematic mode too.

    Best,
    Pärtel
     
    camerondus likes this.