PuppetMaster - Advanced Character Physics Tool [RELEASED]

I did it with “Normal Mode” to “Unpinned”

Hello i have a little problem with my Puppet Master.

I was trying to Lerp the Pin Weight variable to zero while i perform a Jump and i get this behaviour
3245821--249685--lerpPinWeight.gif
The Ragdoll does its normal awesome stuff but the Character Animator and the Bones dont follow the movement, im using Opsive Third Person Controller

These are my settings, the one that is changing in runtime is Pin Weight

Thanks for your awesome support!

EDIT: I just need to find a way to update the Character Mesh with the Ragdoll

Hi. How am I supposed to move a rag doll with my mousepointer? In my game I need to switch from animated to ragdoll when mouse is pressed over the character. This works with setting pinstrength to 0. But the rag doll moves independent from the gameobject then and falls down by gravity. I now need to “hook” the rag doll to the mousepointer to move it. How can I achieve this?

Thanks a lot Partel, everything is working great now :slight_smile:

Hi

And how to check when ragdoll turns on? (with PuppetBehavior Unmapped)

I tried to use head.state.pinWeightMlp but it is always 1

Perhaps with something like this:

muscle.state.muscleWeightMlp = Mathf.Lerp(0.02f, 1f, muscle.state.pinWeightMlp);

Hey,
If using BehaviourPuppet, do not set pin weight to 0, call behaviourPuppet.SetState(BehaviourPuppet.State.Unpinned) instead.

Hey,
If using BehaviourPuppet, do not set pin weight to 0, call behaviourPuppet.SetState(BehaviourPuppet.State.Unpinned) instead. Then disable behaviourPuppet.canGetUp until you need the ragdoll to recover.
About moving it with a mouse, make a kinematic Rigidbody object that you can move around with the mouse, then just add a Joint of some kind that connects it to one of the ragdoll’s rigidbodies.

Cheers,
Pärtel

check for behaviourPuppet.state. If == BehaviourPuppet.State.Unpinned, then your character is ragdolled.

Hey Partel, this was also my first thought to set the puppet to unpinned but later on i was imagine it will be look cooler when the Animation fade out so pinWeight sound for me the better option in this case.
What can i do when i want use pinWeight instead?

EDIT: I found out that the system working fine in the Demo and also with a standard Opsive Third Person Character Setup its working that the Mesh follows the ragdoll when you turn down the pinWeight, i dont know what i mess up with my character but its no bug from the Puppet Master

Hello Partel-Lang,

I developed a program with PuppetMaster in Unity 5.4.1.
After I moved it into Unity 5.6.3, the model controlled by PuppetMaster went down about a meter as shown in the pictures below.

Could you give me some advice about this?

Unity 5.4.1


Unity 5.6.3

Hey partel,
thanks for answering questions.
i’d be really appreciated if you help me too.
how can i switch the state of puppetmaster from alive to dead when my character collides with an object.
let’s suppose my character’s body hits a spear or a knife, after the hit i want alive mode to be switched with dead mode.
how can i achieve that throw script?
thanks

Has the behaviors section of puppetmaster, where you set up walkable and collision layers, been removed?

Hey,
No idea, haven’t seen anything like that, but I doubt it is a PM issue. Is the entire character sunken or just the ragdoll in play mode?

Hey,

So you should make a script that uses the BehaviourPuppet.OnCollisionImpulse delegate to get information when the puppet collides with a spear or a knife:

public BehaviourPuppet puppet;

    void Start() {
        puppet.OnCollisionImpulse += OnCollisionImpulse;
    }

    void OnCollisionImpulse(MuscleCollision m, float impulse) {
        ///if (m.collision.gameObject.layer == knifeLayer) ...
        // if (m.collision.gameObject.tag == knifeTag) ...

        puppet.puppetMaster.state = PuppetMaster.State.Dead;
    }

Hey,
No, they are under BehaviourPuppet, not PuppetMaster.

Best,
Pärtel

Thanksssssssssss, it works :smile:
i was wondering, what’s the best way to connect my character to an object ?
i have a character with puppetmaster applied to it and i want to connect my character to a skateboard and riding it and when he hits an obstacle he would fall down off the skateboard.
but the problem is when i’m trying to connect them throw child and parent relationship
and hit play… my character shows some really strange behaviors, like flying into the air, or going down under the ground or spining madly .
i have also tried to contact them by fixed and character joint but still pretty much the same results.
i have no idea what’s wrong

Thank you for your reply.

I moved a model with animation (before installing PuppetMaster) from Unity 5.4.1 into Unity 5.6.3, and I found it was sunken.
So I think it is not a PuppetMaster issue.

I’ll check model, animation and Unity manual to find the cause of it.

Hey,
Parenting should be fine, just make sure to unparent when the character loses balance. Otherwise the ragdoll will be parented to an object that is separated from it and moving/rotating independently and that would indeed mess up the physics I imagine.

Hello,

I’m encountering an error with the Joint Break method of muscle removal. This is using Unity 5.6.4 and I believe the newest PM version.

When I go to the demo scene and set a joint break of 0.001 so it instantly breaks, I get these errors:

Two for each limb in the chain after joint-breaking the upper right arm. (Each child of the joint broken)

Full text of first error: Destroying components immediately is not permitted during physics trigger/contac - Pastebin.com

Further, on collision, the removed muscle throws this error:

Full text: IndexOutOfRangeException: Array index is out of range.RootMotion.Dynamics.Beha - Pastebin.com

This also happens with my own PM setup.

Thanks for any help.

Hey,
Looks like a bug already fixed for the next version. Contaced you in PM.
Cheers,
Pärtel

1 Like

Hello,

I got this 2 errors at runtime when i am working with my uma character sometimes


Hey,
Is there a specific scenario at which this happens or does it happen just randomly? Are you using BehaviourPuppet and what is the state of the puppet (pinned, unpinned or getting up) when it happens?

I’m out of office next week, I’ll take a look at it in depth as soon as I’m back.

Best,
Pärtel

the puppet is pinned, with default settings on the puppet master and this settings on the BehaviourPuppet

I generate my character with UMA with the BuildUMAPuppet.cs for the DynamicCharacterAvatar.cs

The bug is not annoying, he pops up sometimes when i walk

Mostly the error comes when the Foot hits a object with a different angle of his face then the previous