PuppetMaster - Advanced Character Physics Tool [RELEASED]

Hey, @Partel-Lang

I’m trying out Stagger(Puppet & Stagger my character) .
Note that I have applied all the patches.

I’ve noticed that sometimes he stays bent over and can’t get up.
Sometimes he floats in the air and bends down (looks like he’s sitting normally).
Sometimes they are bent over lying on the ground (not face down, not on their back).

When I observe the event, it is as follows

BehaviorBipedStagger.enabled false;
and()
Stagger: OnFinishied

BehaviorPuppet.enabled true;
and
Behavior Puppet: On Regain Balance

Is there anything I can do to fix this?


Addendum:

If I create a new project, the problem does not occur.
If I apply the above patch, the problem occurs.

I have recently applied the patch, but the problem next occurred even without the patch.

I’ve noticed that sometimes he stays bent over and can’t get up.
Sometimes he floats in the air and bends down (looks like he’s sitting normally).
Sometimes they are bent over lying on the ground (not face down, not on their back).

Thank you very much.

Hey,
Switching behaviours is not supposed to work by clicking that enabled box in editor, call behaviourPuppet.SetState(BehaviourPuppet.State.Unpinned); instead and PM will properly switch to the behaviour that BehaviourPuppet has in the “On Lose Balance” event.

Best,
Pärtel

Thank you.
I will do as you suggest.
I’m not using a standalone Stagger, but the standalone Stagger seems to behave strangely when patched.
https://www.youtube.com/watch?v=gGUBHIYsTKk

Hi, I have a problem with PupperMaster when loading scenes. Sometimes I get naaaasty crackens, characters fly away with arms and legs spaghetified in different directions and then land somewhere in the distance.

Is there a way to fix it?

hello dev amazing work on this asset

how is it we make similar armature and empty (no mesh) rig “cowboy animation target”?

im learning disconnecting muscles example for my own dev, from i understand it, the script “skeleton” can be apply to any models?

when making blender im getting issues for import (no mesh data) and fbx export from unity wont export the “empty mesh” rig only… maybe just problem for me

is anything special for it beyond calling the script and storing reference to puppet master with muscle for object?

must i always use empty rig and match it with mesh per limb??

Hi @Partel-Lang just recently more or less i started playing around with puppetmaster and FinalIk…
First of all let me bow to you, what an awesome product/s

Was wondering how i could accomplish the following with it.

+Grab a puppet with FinalIk/Vrik
+making the puppet Fall depending on where you push it towards

and sry if this was asked before and thx

Hey,
Weird, I can’t see that happening here. Maybe that patch you had is outdated, I just uploaded the latest to this link.

Hey,
Haven’t seen that one before… Are your puppets under DontDestroyOnLoad or are you instantiating them from prefab or do they belong to the scene?

Hey,
I made that model 10 years ago, I’m afraid the source files have gone missing.
Yes, the skeleton script can apply to any model, all it really does is play the hopping animation when a leg is removed and kill the puppet when both legs are removed.

You don’t have to use the CowboyAnimationTarget at all. If you have a model in Blender and that model has an armature, export it to Unity like you normally would. Just parent all bone meshes to their respective bones. The rest of PuppetMaster setup process is the same as it is for a skinned mesh model.

Hey and thanks!

There is a demo about grabbing puppets, it’s called “Melee Grab”. In that demo there is no IK for moving the hand to the other puppet, it just connects the hand rigidbody to whatever ragdoll it collides with. But to create IK for that, can just add FullBodyBipedIK or ArmIK or LimbIK to the character, set it’s hand target to what you wanna grab and blend in effector position weight. Just make sure to do it when standing close enough to the other puppet.

Cheers,
Pärtel

1 Like

thanks very much dev!

i did what you said and it worked!

now i have other issue with bone(armature) position on the import and setup for humanoid rig i used and armature create in blender itself, some time missing limb of empty armature on export to unity…confusing

thx @Partel-Lang
now i got a weird issue, that seems to happen when the puppt gets killed it starts to float above ground but continues to do its routine… might just be my own fault, messed up something or overlooked

Sorry, I’m not that familiar with Blender. Used to work with 3ds Max and Lightwave, but that was 7 years ago.

Hey, did you already figure it out (on Discord) or was that someone else with a similar question?

Cheers,
Pärtel

1 Like

Hi Pärtel,
I would like to ask if PuppetMaster can be used to set up active ragdoll movement ? Like the game Human Fall Flat where the character is clumsy and easy to fall. And the player will have to fiddle with movement to help the character stand up straight. Is there any example in the package to support this out of the box ?

@Partel-Lang sry yes that was me… this here is just my alterego^^
and sry for not writin earlier but tbh i have never encountered such fast support!!!

1 Like

Hi, I mentioned your character animator culling mode is set on “Always Animate” but I get a lot more better performance when I set it to “Cull Completely”! I have 60 characters on my scene. Can I do that without any issue?

Hi Partel, I’ve been having an issue that I can’t figure out. I’ve attached a video here:

I’m trying to do a simple explosion with this line:

 col.transform.root.Find("Behaviours").Find("Puppet").GetComponent<BehaviourPuppet>().SetState(BehaviourPuppet.State.Unpinned);

and add this after: rb.AddExplosionForce(force,transform.position,radius);

but it is causing the bug in the video. However if I use this line instead:

col.transform.root.Find("PuppetMaster").GetComponent<PuppetMaster>().pinWeight = 0;

it works perfectly. Unfortunately that creates other issues when it comes to resetting the pinWeight to 1.

I was wondering if you knew how to fix this?

Full code here:

 Collider[] colliders = Physics.OverlapSphere(transform.position,radius);

            foreach (Collider col in colliders){

                Rigidbody rb = col.GetComponent<Rigidbody>();

                //turn off IK
                //Drop prop?

                if(col.gameObject.name == "Hips"){
                    // col.transform.root.Find("PuppetMaster").GetComponent<PuppetMaster>().pinWeight = 0;
                    col.transform.root.Find("Behaviours").Find("Puppet").GetComponent<BehaviourPuppet>().SetState(BehaviourPuppet.State.Unpinned);



                    // behaviourPuppet.SetState(BehaviourPuppet.State.Unpinned);
                if(rb != null){
                    rb.AddExplosionForce(force,transform.position,radius);
                    Debug.Log("boom");
                }
            }
        }

Hey,
I don’t know exactly how HFF was made so can’t be sure, but from the way it looks, I think it is using rigidbody and capsule collider for the character controller. The ragdolls are just connected to that and animated physically via muscles. So the self-balancing is not real, but faked with something similar to PuppetMaster’s pinning forces.

With PuppetMaster you could do something like that, for example if you went to the “Basic” scene, expanded the Muscles array on the bottom of PM and set “Pin Weight” to 0 for all the muscles except for the pelvis, spine (for keeping the body upright). Enable “Angular Pinning” to lock facing direction so the ragdoll doesn’t just spin. Increase “Muscle Spring” to something like 200.

You’d also want a Rigidbody and a CapsuleCollider or a CharacterController on the gameobject that has the Animator. That would be your character controller, you can add forces to the rigidbody to make the character move. Make sure that capsule doesn’t collide with the ragdoll layer (Layer Collision Matrix).
Then you’ll just need to play some kind of walking animation in the direction you are moving with that character controller.

To make the puppet fall, set PuppetMaster pinWeight to 0.

It will look much better with blob-like characters with small legs and arms like HFF has.

Hey,
If you have “Fix Target Transforms” enabled in PM, then it should not be a problem to use Cull Completely. Otherwise PM mapping would get into a vicious cycle of additively reading/writing the pose frame by frame (with nothing overwriting it in between) and the ragdoll would eventually freak out.

You might see a problem with fallen ragdolls stopping their animation. That would happen when physics moves the ragdolls out of their SkinnedMeshRenderer’s bounds and the animation gets culled. So it might be a good idea to use “Always Animate” while behaviourPuppet.state == BehaviourPuppet.State.Unpinned and “Cull Completely” at all other times.

Best,
Pärtel

1 Like

Ok thank you, I’ll check this but for now I mentioned if I enable PuppetMaster on all 60 characters it reduces frame rates from 120 to 2 fps! I remember it wasn’t like this before!

Hey, i cant figure out what causing crazy jitter when mappingWeight in Puppetmaster is not equals 0 or 1.
Animator is set to AnimatePhysics mode, im trying to smooth cull puppetmaster, when there is no collisions.
Or maybe there is method or variable that stores current applied force to muscles?
Was not able to locate any included method to check current deviation from animator.

Hey,
With 60 active ragdolls in the scene, I’m not surprised the framerate is bad… But it shouldn’t be as bad as 2 fps. Maybe you had some object selected in the editor? That usually slows down fps by a lot in editor.

Hey,
Culling PM when there are no collisions can be done just by setting BehaviourPuppet’s “Normal Mode” to “Unmapped” or “Kinematic”.

Best,
Pärtel

For sure, but with only one Puppet on scene Disabled mode is saving like ~0.2ms CPU comparing to Kinematic mode. What im trying to do is to lerp Mapping weight to zero if there is no colliders within overlapSphere and then set disabled mode. But while mapping weight is anything but 0 or 1 mesh is jittering crazy between two positions (animator and puppet). Lerp is required due to possible fast colliders that may collide with puppet and fly away from overlap sphere what will cause instant recover of animator no matter what impulse was made. Other possibility i see is to check when puppet (not knocked out) is recovered pin and set it to disabled, but i wasnt able to locate any methods yet

UPD: nevermind, just added some code in BehaviourPuppet fixedUpdate:
In foreach Muscles

currentPinMedian += Mathf.Clamp(m.state.pinWeightMlp, 0F, 1F);
currentPinsCount++;

And after

currentPinMedian = currentPinMedian / currentPinsCount;

But not sure about performance :smile:

Hi. Trying to make Puppet Behaviour work properly with particle collisions.

The problem is that Puppet Behaviour didn’t handle particles collision so I think because of this unpinning doesn’t work properly.

Only way it works is by knock out distance.

In demo scenes Pin Weight for puppet master is 1.0, but in this case puppet doesn’t react to particles collisions.

In case I make it, for example, 0.6, it start working but if loose balance on start.

How I can fix this “loose balance on start” issue? Current workaround is to start with pin weight 1.0 and lower it smoothly in a first few seconds to 0.6. But I don’t think that this is the best way to do it.

May be I can somehow simulate collisions by code?