How to fix Colliders flying off after activation?

I have a ragdoll on a humanoid enemy set up using the default ragdoll wizard. I’m trying to “gib” the enemy by deleting all the character joints. But once all the joints are deleted, some of the limbs fly off at great speed as if they have been pushed.

Here’s a step by step breakdown of what’s happening:

  • at startup all colliders are disabled and all rigidbodies are set to isKinematic
  • enemy dies
  • all colliders are enabled and all rigidbodies are set to NOT isKinematic
  • delete all Character Joints
  • some limbs go flying

I’m not sure why this is happening. Only thing I can think of is colliders start inside each other so they over correct or something?

I’ve tried setting all the rigidbody.velocity = 0 after I delete all the character joints but it still happens.

Any one have any idea how to not have things fly off like this?

Thanks

In case anyone ever looks at this, the issue seemed to be that I was detecting a collision, moving the object and activating the ragdoll all in the FixedUpdate() method (I’m using a raycasting system instead of colliders). So I ended up storing the collision data and processing it (activating the ragdoll) in LateUpdate() instead of immediately in FixedUpdate().

It sounds a bit yuck but seems to be working fine.