How to do it...

To create a generic ragdoll, follow these steps:

  1. Import the character to Unity and place it in the scene.
  2. Select all the bones of the character's rig that will be used in the ragdoll simulation. In our example, we skipped the fangs.
  3. Add Capsule ColliderRigidbody, and Character Joint components to the selected bones.
  1. Adjust the shapes of the colliders to match the limbs of the character. You should avoid colliders intersecting with each other. You may need to change a few colliders to Box Colliders or Sphere Colliders (our Spider's abdomen has Box Colliders instead of Capsule Colliders and the head has a Sphere Collider).
  2. Make sure all Character Joints have the Auto Configure ConnectedAnchor option selected.
  3. Choose the root body part of your character (for our Spider, it was the abdomen).
  4. Remove the Character Joint component from that body part to make it work just like a normal rigid body.
  5. Connect all other Character Joints to their parent game objects (also containing the Character Joint components). For instance, if the character has a leg with three segments, Leg1Leg2, and Leg3, drag the Leg2 object to Leg3 object's Connected Body field in the Character Joint component. Then drag Leg1 to the Connected Body field of Leg2. Finally, drag Leg1 to its root bone's Connected Body field (in our case it's the Abdomen).
  6. Repeat this process for all the bones with Character Joints. The hierarchy of the joints should reflect the hierarchy of the rig.
  7. Disable the character's Animator component and play the game to see the effect. You may need to further adjust Character Joint components' properties to achieve the desired effect:
Spider with a defined ragdoll
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.9.169