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?

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.