- Home /
Character animation/ragdoll problem
Hi
I have 3d character that uses legacy animations. When it dies it has die animation. But if charater dies in staircase or slope it sinks inside objects or "hangs" in air.
I have added ragdoll to the character and now when the die animation ends it behaves many times normall. But problem is if enemy dies near walls or slopes this animation will drive the charater inside the wall or floor collider before the ragdoll effect kicks in. So when die animation ends it bounces the ragdoll out from the collider or sometimes the charater gets stuck inside the object and limbs get stretched etc.
How can I prevent this from happening?
Answer by NGC6543 · Dec 30, 2015 at 09:34 AM
Unity's Animator Controller(Mecanim) has an option "Animate Physics". But you are using the legacy animation component so this would not be an option.
If the character has a Rigidbody component and is not kinematic, then probably you could attach primitive colliders to bones(for example on head, chest, fore arms etc) and they might being pushed out when the die animation is in action, I think.
I have colliders in every joint. Is it possible to stop the die animation and start the rigidbody effect whet the character collides anyobject. This way I could run the die animation as far as possible?
hi @jester$$anonymous$$aster, I have an experince with the Animator Controller but I'm not an animation guru so I can't tell exactly waht to do, sorry. The question you had asked via comment... If colliders are attached like that, probably a script that is attached to the root gamepbject can detect wether one of its colliders had collided to a wall or not(if walls are in a separate collision Layer) and from that event I think you can enable the ragdoll effect accordingly.