Blend Tree always play the wrong motion for one frame after the transition.

Here’s a quick glance at my setup, it is a 2D game with fbf animations:

What i’m doing here is passing to the Animator system a facingDir float, which is always -1 or 1, wich means Left and Right. And then all my animation states are blend trees that select between LEFT or RIGHT animation based on the facingDir attribute.

What i’m noticing is that the first frame after a transition between states the blend tree plays the wrong motion before playing the right one. I.E: If my character is moving RIGHT, then when the state machine transition to the Run animation, the blend tree will play the RUN LEFT animation for one frame, and readjust for RUN RIGHT the next frame onwards.
This happens even though in the Animator the blend tree has the RUN RIGHT correctly selected and the facingDir parameter never changes to the wrong value, but for one frame the character playes the RUN LEFT one.

Not sure if this is a bug or something particular to the blend tree. Either way i wanna know if there’s something i can do to correct this behavior before redesigning my animation states to not use blend trees.

2 Likes

Calling animator.Update() would probably skip the bad frame, but that’s a massive performance cost for something so simple.

Tried just for the sake of it, but the issue still occurs.

I am also running into this. I have an idle and an idle shooting animation, but one incorrect frame plays before the proper of the blend tree.

Hi, I am also running into a very similar problem, just I have 2D pixel art sprites and when transitioning from attack animation to idle, the wrong frame plays(more in the middle of idle animation) and then it starts idle animation from start as normal… did you find any solution? If you did, please share it, it would be greatly appreciated!

Best regards,
NonSuspicious

Same issue here :).

Try to make the Transition Duration 0 and disable Exit time

1 Like

I had the same problem. I had Exit Time uncheck already, but didn’t check under that for Transition Duration(s). Once I changed that to 0 from the default of 0.25, everything worked perfectly. Thanks, Paul!