- Home /
Rigidbody and character foot placement/slippage
Setup: 3D rigged humanoid with Animator, capsule collider and rigidbody (rotation frozen on X, Y, Z) - everything else such as scripts and NavMeshAgent are absent. The animator only has a walk animation (looped). Neither the collider nor the "floor" have physic materials assigned.
Issue: The character is moonwalking. The feet are pushed back with each step, slipping on the floor. If rigidbody is removed, animation is processed correctly, feet stay grounded until next step. If kinematic is checked, feet stay in grounded correctly but start trembling, making the whole walk cycle look unnatural. The results are the same whether or not "foot IK" is enabled.
Any solutions?
Thanks in advance :)
Answer by indieman · Jul 09, 2016 at 02:36 PM
I think I found a solution. First, it matters how your animations are set up. For instance, some work better with "Root Transform position (Y)" based on Feet, others work better with the baked original animation.
The real issue is the foot slippage, and it has to do with friction, namely that between the collider and the ground. For individual objects it works to just add the "ZeroFriction" Physic material to the collider, but if you want to do it by script so that all your prefabs will use zero friction, just add this to your main controller script:
public Collider col;
void Start()
{
col = GetComponent<Collider>();
col.material.dynamicFriction = 0f;
col.material.staticFriction = 0f;
}
There might be better ways to do it, but so far I didn't find any.
Your answer
Follow this Question
Related Questions
Automatically adjusting the speed of a walking animation to avoid foot-sliding? 1 Answer
mecanim and rigidbody gravity effect doesnt work 1 Answer
Mecanim Inherit Velocity of previous animation? 0 Answers
If my object moves -- Detect on carachter controller? 0 Answers
How to handle knockback 0 Answers