Unity Physics: Creating and Customizing Ragdolls
Getting started using ragdoll physics is easy and painless…except for the test dummies being dropped for this article.
For the Ragdoll system to work, your model needs to have a working rig.
Add a ragdoll to the model under 3D Objects > Ragdoll.
The ragdoll wizard will open with empty assignment boxes.
Assign each rig object from your model to the wizard.
Make sure to match the correct names to the appropriate boxes.
After all slots have been assigned, press the create button.
Colliders and Rigidbodies will be added to the rig objects.
You can view and adjust each collider as desired.
The ragdoll is already working and ready to go. Ouch!
The default head collider is off position to the model.
Let’s tighten that up.
In order to add more body parts to the ragdoll, first add a collider to the rig object. Here is the left foot rig with a capsule collider.
Add a Character Joint component to the object, which will place a rigidbody on it as well, if there isn’t one already. The Connected Body assignment is looking for the closest rigidbody in the rig, which is the left leg in this case.
The default angular limits look ok for this example.
The hands get the same treatment.
Here is the final ragdoll setup.
That looks a bit more natural compared to the first one.
Watch out for falling grunts on your way and thanks for reading!