Search code examples
c#unity-game-enginephysicsunityscriptragdoll

Unity 2d Ragdoll Inconsistent issue


I have a 2d character(side scrolling) with run/idle animations and movement works fine too. also character is attached with die/ragdoll script and this script does 1- disable animator 2- disable rigidbody(for whole character) 3- disable collider(box collider for whole body) 4- disable script and to enable ragdoll 5 - enable collider for each body parts (body,head,legs,arms..etc) 6 - enable hinge joints for each body parts with limited angles 7 - enable rigid bodies for each body parts Now the problem is when this script is called, inconsistently the whole body falls down with a jerk of 2 - 3 inches.
am i missing anything when i need to do ragdoll, please help.

Thanks


Solution

  • Ok, Now i added one more step and its fine now. 8 - by default set the gravity scale (of rigid body parts)to 0 and when character dies set it back to needed value.