Exit Time of 1, but animation exits before finishing (full example included)

As a simple example, I did the following steps in a new project in Unity 5.0.0f4:

  1. Create a cube.
  2. Create an Animation called “TestAnimation”.
  3. Drag “TestAnimation” onto the cube - this will create an AnimatorController called “Cube”.
  4. On “TestAnimation”, record the cube scaling from 1,1,1 at 0:00, to 2,2,2 at 0:30 (just the 2 keys).
    In the Animator, do the following:
    5.1. Add an empty “New State” to Cube.
    5.2. Turn off “Write Defaults” in “TestAnimation” and “New State”.
    5.3. Add a transition from “TestAnimation” to “New State”.
    5.4. On the transition, change Exit Time to 1, and Transition Duration to 0.

[Note - if you don’t want to do all that then I have attached an example project.]

When you hit Play, you should see the Cube scale up - but it will never be 2,2,2. Each time you Play, the result will be slightly different, it might be 1.969842,1.969842,1.969842 or 1.974897,1.974897,1.974897.

I would like to know why, with an Exit Time of 1, does the animation exit before actually finishing (i.e. the scale reaching 2,2,2)?

As a workaround, you can increase Exit Time to something like 1.1, and the cube finishes scaling, but it doesn’t feel right to do this as any amount over 1.0 is intended to start repeating the animation (when loop is enabled). Interestingly, I can even set Exit Time as high as 1.04, and it still exits too early.

Any insight would be much appreciated!

2071075–135132–MecanimTest.zip (371 KB)

No ideas anybody? Is this a bug in Unity or am I doing something wrong? Please help if you can.

Hi dCoding,

You are right that sound like a bug, the animation should be played up to 100% in this case.
please log a bug with your project.

Thanks Mecanim.Dev, I have now submitted this as a bug report.

Thx, send me your case number when you get it for the follow up.

Sure - the case number is 691710.

A quick update - I’ve tried the same example project on the just released Unity 5.0.2f1, with the same results.

Hoping this will get looked into at some point!

Hi dCoding,

We are looking at this issue right now and we hope to provide a fix in 5.2, if the fix is simple enough we will backport to a previous version like 5.1 or 5.0.

1 Like

That’s fantastic - thanks for the update.

Any news on the fix?

Still having this issues as of 5.3.0f4 has this bug been fixed yet?

Any news about it ? I got similar issue with “Exit Time” sets to 1, sometines it keeps the last frame of animation few frames before doing the transition.

I’m pretty sure I’m seeing this occur in Unity 2017.1.0f3, too.

EDIT: It looks like others have run into the same issue (where the last frame isn’t always played before transition occurs).

2019.1.9f1 got this issue too

1 Like

I’m still having this bug with Unity 2019.2.9f1 and it’s really annoying… If it’s not going to be fixed, is there at least a workaround ?

2020 and still an issue?

Anyone still struggling with this issue might be interested in Animancer (link in my signature) which does not have the same problem. One of my unit tests verifies that using End Events to play another animation will properly apply the last frame of the previous animation first.