- Home /
Using Ragdoll on character with mecanim animator
Hi to all, I've a humanoid character animated by Unity Animator. For the moment, for test, I'm using mecanim default controller (used in mecanim demo scene).
I need for realistic falls, so I've added a ragdoll to my character. When it has to fall, I simply disable animator and change some ragdoll joint attributes.
Usually the falls are ok, but sometimes (let's say 1 time over 5-6) the character falls in the infinity (his fall is not blocked by ground).
I've noted that the problem is more frequent during jump animation.
What could be the cause?
Where Am I wrong?
void Update()
{
// ....
if ( /*fall condition*/ )
{
Ragdoll( !activeRagdoll );
falling = true;
}
// ....
}
public void Ragdoll( bool activeRagdoll )
{
/* some ragdoll joint adjustment */
/* ... */
/* HERE I DISABLE THE ANIMATOR*/
animator.enabled = !activeRagdoll ;
}
Hi! I don´t think the code snippet you showed us has much to do with the problem. $$anonymous$$y guess is that the colliders you have attached to the ragdoll, is poorly configured somehow.
I assume they are not mesh colliders?
Answer by Alexandros1313 · Feb 18, 2013 at 11:10 AM
I've a capsule collider for each ragdoll part, and a big capsule collider for the whole character (used by animator for root motion).
I've observed the following behavior when it doesn't trepasses the ground, examining it frame by frame: When my character falls from a big height, I note that until the animator is running, the big capsule collider works and the character keeps on ground level. After a while, say a couple of frames, I see my char fall in the ground until the pelvis, then, when animator is really not enabled, it's bounced up , and then the ragdoll falls on the ground.
Answer by chrisMary · Feb 03, 2014 at 03:44 PM
Doesn't it have to do with the fixed timestep being too high ? (Project settings > Time)
Your answer
Follow this Question
Related Questions
Mecanim and Ragdoll Issues? 2 Answers
how to stop animator? 4 Answers
IF YOUR ANIMATED RAGDOLL CHARACTER FALLS THROUGH FLOOR READ THIS 1 Answer
Switching Animator on/off 0 Answers