- Home /
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
Answer by FG_dev1 · Oct 23, 2015 at 07:21 AM
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.
Your answer
Follow this Question
Related Questions
Ragdoll stucks in objects 0 Answers
Ragdoll with multiple colliders 0 Answers
Colliders going through Colliders? 1 Answer
Unity3D Rigidbodies acts like objects is elastic and falling inside eachother 0 Answers
problem with 2d ragdoll to animation 0 Answers