AnimatedRagdoll
A class in Root.Township, the global namespace.
Drives a physics ragdoll to follow an animated skeleton: each ragdoll bone has a ConfigurableJoint whose slerp drive targets the matching animated bone's rotation, and the root is pulled to the animated root.
- Listed in Global namespace: A to B
- Inherits or implements
MonoBehaviour - Nested types
Bone
Constructors
| Member | What it is |
|---|---|
AnimatedRagdoll() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private Transform animatedSkeletonRoot | Setup only: root of the animated skeleton. Setting it with ragdollSkeletonRoot rebuilds bones and clears it. |
private AnimatedRagdoll.Bone[] bones | Per bone: the animated transform, ragdoll rigidbody and joint, plus torque, damping, force and mass multipliers. |
private ColliderGroup colliders | Collider group for the ragdoll. Not read in this class. |
private float dampening | Base joint drive damper, scaled per bone. |
private Quaternion[] initialRotation | Each bone's starting rotation in joint space, used to work out target rotations. |
private Quaternion[] jointToLocal | Inverse of localToJoint per bone. |
private Quaternion[] localToJoint | Per bone, the rotation from bone space to the joint's axis space. |
private float maximumForce | Base joint drive force limit, scaled per bone. |
private Transform ragdollSkeletonRoot | Setup only: root of the physics skeleton that bones are matched in. |
private float torque | Base joint drive spring, scaled per bone. |