[Fixed, sort of] Ragdoll Stability

I’ve got two sets of ragdolls. One I just leave as is to test it (top-right of attached), it falls to the ground and behaves as expected when it collides w/ the floor.

The other I activate when any limb collides with a solid surface (ignoring it’s own limbs). The limbs are previously driven by animation and a parent above (controlling the root) is driven by a rigidbody (Think of someone snowboarding flying through the air and grabbing their board). When the limb collides with a surface, I:

  • Stop playback of the animation and disable the animation component
  • Ensure all the limbs are no longer kinematic
  • Unparent the ragdoll from it’s parent rigidbody so the ragdoll would stop being driven by it

The ragdoll then behaves erratically, joints oscillating across the above screen every frame. I have the solver iteration count set to max. None of the limbs collide with each other. I’m at a loss.

Even more frustrating, when I pause the editor to go frame by frame to get a better look at what’s breaking, it behaves as expected, the character joints bring the ragdoll back to a stable state.

Any help?

So far it looks like increasing the joint limits is helping. If I put all the limits to max it doesn’t “explode”, bit the ragdoll looks very broken. I’ll have to live with it for now.

I am experiencing the same issues in Unity 5 beta - 14b. I am also struggling to find a solution as to why my character is “exploding”. To clarify, what did you mean by increasing the joint limits to the max? Are you talking about “Low Twist Limit, High Twist Limit, Swing 1Limit, and Swing 2Limit”. What were the “max” values you tried for those?

Thanks!

That’s correct steampenny, I set those values to the max and it’s doing the trick, but the doll doesn’t look right since limbs and joints can bend in all directions.

I had that issue too. I realized there were animated boxColliders/meshColliders in my scene whithout a kinematic rigidbody attached. Once I added the rigidbody to those prefabs and set it to kinematic the ragdolls worked again.

Ah, I’ll give that a try

hi,

Please see the chapter on ragdoll stability at

Also the physics upgrade guide could be useful (info might be repeated)
http://docs.unity3d.com/Manual/UpgradeGuide5-Physics.html

Cheers,
Morten

The new PhysX joints are very unstable - in 4.6, they were a lot more robust at resolving the constraints.

I find it ridiculous that we’d need to use projection now whereas previously it was optional, or that we’d need to use 10-20 iterations per frame, whereas 6 was enough before. Even with these changes, the joints won’t explode but the ragdoll will still twitch the hell out when you put it’s joints under the slightest stress.

Here is proof - side by side comparison demos: https://dl.dropboxusercontent.com/u/38666531/Physics Demos 6 Iter.zip

This seemed to more or less fix the problem:

  • Ensure all rigidbody parts are the same mass (had the biggest impact by far, even mild deviations, like mass ratios of 1:1.5 caused major instability)
  • Turn on projection for all character joints (I used 0.5 for distance and 45 for angle)

Changing solver iteration count did nothing apparent values of 7, 20, and 64 had no noticeable difference

2 Likes

In my case I have setted all ragdoll´s rigidbodies to isKinematic=true and the elasticity has gone, hope this helps someone to

@leslie718, switching isKinematic on and off?
(isKinematic is false)
isKinematic=true;
isKinematic=false;

if isKinematic keeps being true then the dynamics won’t move the bodies at all.

Essential watching for Ragdolls (starts @ 26:45)

The slides are here, the 3d physics starts at page 14: Unite Boston 2015 Physics | PPT

Setting Projection to true has done the trick!

Thanks for these tips, really helped me a lot.

For me it was the large capsule collider used in my character controller! I was transitioning from an animated character to a ragdoll. This woks for me:
First…
Gather rigid bodies and colliders in the ragdoll, disable all ragdoll colliders
On transition…
For each ragdoll Rigidbody: set IsKinematic=false, set velocity and angular velocity to zero
For each ragdoll collider: enable
Disable character animator
Disable character’s capsule collider
Set character’s velocity to zero (optional)

Thanks Morten for the links above.