- Home /
How do you allow the joints in a character to freely fall based on gravity?
I am building a game in which the character in the game has to fall down on death. Is it possible to make the joints fall and bend based on gravity? That is to leave the joints fully dependent on gravity and collision and not influenced from some skeletal animation.
Answer by darksider2000 · May 12, 2020 at 07:04 PM
You should start by looking at Unity's Ragdoll Wizard.
But if your character model isn't very complex, or you want to go for something simpler you can make your own Colliders, Rigidbodies and Joints per body part.
All you really need for this behavior is a collider for collision detection between a body part and the ground/other body parts; A rigidbody that applies physical forces to the body part (gravity, etc); A joint that connects between various body parts to create the movement you want.
Then it's all about fine tuning the properties, like Rigidbody mass or Joint max angle etc.
Make sure to have gravity enabled on the rigidbodies and in the project settings.
If you want to be able to switch between animation and ragdoll behavior you can disable/enable the rigidbodies, or tweak their values with code.
Let me know if this helps!
Thanks, that answer really helped. I tried out the Ragdoll Wizard and made some adjustments and added new body parts. In the end, it worked.
Your answer
Follow this Question
Related Questions
How to have a collider inactive only during attack animation and not during 'charging' animation? 1 Answer
Animating a humanoid skeleton using text files 0 Answers
Unity 4.5.2 bug changing the properties of the 2d colliders in animation 1 Answer
How to jump on to a turret gun 2 Answers
Switch Weapon using Animation 1 Answer