The system implements a ragdoll system with accurate physics hit reactions that can be used as wished along with animated hit reactions.
Ragdoll system has humanoid and generic versions ( 'RagdollManagerHum.cs' and 'RagdollManagerGen.cs' )
On humanoid, ragdoll system can be created automatically upon creating a player and/or NPC in a single click by assigning humanoid bones from animator (
'Animator.GetBoneTransform(...)' )
If skipped at player or NPC creation, ragdoll system can be created by clicking on 'Ragdoll Wizard' button in 'RagdollManagerHum' component.
Ragdoll wizard opens ragdoll creation window where ragdoll bones can be individually assigned and ragdoll system created.
The system then creates needed colliders, rigid bodies, joints, body part scripts etc. on those bones
On generic NPCs, ragdoll components need to be created manually.
Generic rigs can have all kind of shapes with multiple or no limbs, two or more heads etc. so a user must manually choose bones and create collider/s, rigid bodies and joints.
Creating ragdoll system manualy on generic:
- On each bone that will be used in the ragdoll system create collider and rigid body.
- After that is done, connect needed bones with 'CharacterJoint'.
- Next drag all those bones to 'RagdollManagerGen' component 'RagdollBones' array field and click on 'Add Collider Scripts' to finish.
Then the system will create all other necessary scripts needed for ragdoll to function properly.
In this video is example of creating generic rig ragdoll system: