Stablized Ragdolls
Added 2021-03-21 23:05:30 +0000 UTC
Clicky! VLink to video:
http://koboldkare.com/URqZYlwBbP.mp4Clicky! ^Finally stabilized ragdolling. Here's a demonstration that shows a good portion of the new map too! (Don't worry, she's fine!)
This required a huge amount of experimentation, here's a list of fixes I had to employ for Unity ragdoll jitter:
1. Calling `joint.autoConfigureConnectedAnchor = false;` every frame totally resets the joint's memory of which direction it should be facing. Effectively disabling angle limits. So make sure to only set it once!
2. Skinned mesh renderers arbitrarily update before and after the Rigidbody interpolation step, which causes lots of jitter. Make sure Rigidbodies' interpolation mode is set to None
3. If you ever need to switch the connectedBody of a joint, the only way I could figure it out is by literally destroying and recreating it! Otherwise it doesn't initialize the starting rotation and limits properly.
This involves a complicated process of Destroy()ing the joint--
Moving the rigidbody into position using Rigidbody.position and Rigidbody.rotation, NOT Transform.position/rotation--
Then waiting for the FixedUpdate so that the rigidbody finishes interpolating into position.
Finally regenerate the same joint.
4. Some joints require to not be children of other rigidbodies. As the movement of one will affect the other, CharacterJoints seem to be immune to this effect. Though ConfigurableJoints probably shouldn't be a child of whatever they're attached to!
5. Everything from the Unity Ragdoll Stability docs.