- Home /
Character ragdoll to character animation?
Hi all. So I have this character modeled, rigged, and animated in Maya. I want to know if it is possible to switch back and froth between animation and the ragdoll. For example, the character starts off by being a ragdoll, and when he lands, a walking animation is played.
Answer by pyro · Oct 30, 2010 at 01:24 AM
First use the Ragdoll Wizard (located in GameObjects->Create Other->Ragdoll...) and drag the limbs into the wizard to create the ragdoll.
Then in a script you would change the value of "isKinematic" for all of the ragdoll's individual rigidbody components to true, and then start playing an animation on it to have it be animation controlled.
To change it back to a ragdoll you would set all of the isKinematic values to false and stop the animation.
Thanks for this. I found this works really efficiently if you use GetComponentsInChildren to populate a rigidbody array automatically for each limb, then use foreach on the array to set all of them.
Answer by The-Arc-Games · Oct 29, 2011 at 09:48 AM
There's several ways in which you can achieve your desired result, pyro's suggestion being possibly the most common.
The alternatives being a 'full ragdoll' setup, where you actually always have a physics driven gameobject, and the instantiation approach, where you transition in and out of a ragdoll prefab to minimize instantiation and maximize performance for your game object.
The kinetic approach is good since it requires a single iteration to transform your game object into ragdoll, but requires a persistent collider setup which reduces performance.
The full ragdoll is the most fun since your game object will always behave as a ragdoll, and thus will be driven by forces which makes 'falling' transitions very easy, but it's expensive in terms of resources, and can lead to somewhat unexpected behavior.
The instantiation approach is the less resource intensive, but requires tailoring for the various trigger events, and for the correct instantiation or of both the ragdoll and the original game object.
If you want to save time and trouble understanding how the ragdoll wizard works you can check URG!, an automatic ragdoll generator which is available in a free version, that will help you greatly in understanding proper ragdoll creation.
Your answer
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
IF YOUR ANIMATED RAGDOLL CHARACTER FALLS THROUGH FLOOR READ THIS 1 Answer
Ragdoll on Only Part of a Model 2 Answers
Best way to move a rigid body to an empty's position? 0 Answers
How should I make a animate fully physics based Active Ragdoll? 0 Answers