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?