- Home /
Need help with fixing position of Colliders for a Ragdoll
Hi, I have set up a Ragdoll for a Character that is controlled by a NavmeshAgent.
Now when the Character is dead, I disable the navmeshagent(other script) and set every collider.isTrigger of the Ragdoll to false like this:
public void SetRagdoll(bool isActive){
animator.enabled = !isActive;
foreach(Collider c in Ragdollparts){
c.isTrigger = !isActive;
}
}
The problem is that while the animator on my Character is active, the ragdollcolliders try to follow the limbs which creates a huge offset for the colliders.
When I set SetRagdoll to true, it seems like the colliders on the limbs are stuck in the ground which leads to weird behavior of the ragdoll.
I recorded a Gif to help you see whats going on: https://imgur.com/IBgEWkl
How can I fix this problem?
Answer by W1zzel · Jul 01, 2020 at 12:24 PM
I got it working by setting
c.attachedRigidbody.isKinematic = !isActive;
Your answer
Follow this Question
Related Questions
OnMouseDown not firing if character isn't touching ground 0 Answers
ragdoll disappearing when off screen 5 Answers
Physics.OverlapBox colliding with disabled MeshCollider 1 Answer
Model tips over for no reason 1 Answer
Humanoid Locomotion in Unity,Trying to implement locomotion in Unity (with ml-agents) 0 Answers