Here’s the problem: I have animator with blendTree (idle-walk-run), walk and run animations have footstep animation events, I use SetFloat to control parameter that controls blendTree.
With damp value 0: everything works perfectly, animations play correctly, footstep events fire only while walk/run animations. But transition is very jittery.
With damp value other than 0: when I walk and then release button, character smoothly stops but animation events still fire. In animator blendTree’s value smoothly goes to 0 and when it almost reaches 0 it goes crazy to 5-6. It doesn’t affect animations visually but because of that footstep events still fire
Bump
Bump x2
Bump x3
Bump x4, I’m getting this same issue. Exact same problem actually.
Edit
Here’s how I fixed it for me at least. It’s working for now but it’s 3am and I haven’t tested it extensively so who knows.
if (animator.GetFloat(Forward) > 0.1 || forwardAmount > 0)
{
animator.SetFloat(Forward, forwardAmount, 0.2f, Time.deltaTime);
}
else if (forwardAmount == 0)
{
animator.SetFloat(Forward, 0);
}
Hello,
First apologies for leaving you hanging here with 4 bumps.
From what I understand of your issue, it seems that this could be expected behavior if your idle animation is significantly shorter than your walk and run cycles.
When you put animations in a blend space, they are automatically synchronized based on normalized times. This means that any animations playing together will be time-scaled such that they loop at exactly the same time. This means when you are 99% on walk and 1% on run, your animations will mostly play at the same speed as the walk, and the run will be scaled to match. This scaling is done proportionally based on the weight of the aniamtions.
However, you have to be careful if adding an idle to your blend space. Imagine you have a very short idle, e.g. 0.1 seconds, and you match this with a 2-second walk cycle. When your blend is mostly on your idle, you will end up scaling the walk cycles speed to match the idle. This will speed up your walk cycle considerable and cause your footstep events to fire in rapid succession.
You probably only notice this effect when damping your forward amount since this will cause you to spend longer at values close to idle.
My recommendation would be to make a separate state for the idle animation instead of having it in the blend space with walk and run. If there is a reason why you really must have idle in the blend space, I would recommend to make sure its length matches the walk cycle as much as possible.
Hope this helps!