Animator play the same animation in the same frame doesn't work!

Let’s say I have 2 animation, “Idle” and “Run”. If I call them in this way.

// before I call this method, I am in "Run" state
void Test()
{
    m_Animator.Play("Idle");

    // for me it should play "Run" still, but it plays "Idle" actually
    m_Animator.Play("Run");
}

Is that a bug?

How could I deal with it?

That’s just one of the many stupid things about the way Animator Controllers work. You could report it as a bug, but don’t get your hopes up.

The obvious workaround is to figure out what you want to play separately then only call Play once at the end of your Update method.

You might also be interested in Animancer (link in my signature) which lets you avoid Animator Controllers and properly control everything in code. This particular issue was actually one of the reasons I made Animancer in the first place.

1 Like