There's more...

You can also use the concept illustrated in the Destructible objects recipe to store the velocity of the character (or of its limbs) and then apply it to the ragdoll's body parts. To do so, you may calculate the linear and angular velocity of any given body part in the Update() function, by subtracting the previous position from the current position, and the previous rotation in Euler angles from the current rotation. Then you can apply the calculated values as the velocity and angularVelocity to that part's Rigidbody component when you turn the ragdoll on.

..................Content has been hidden....................

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