What is expected behavior when an AnimatorStateTransition has ExitTime=1 and Motion=None?

I have an Animator with an AnimationState which is responsible for running a transform animation. The AnimationState is set with HasExitTime=true and ExitTime=1, and there are no conditions in the condition list. If I don’t specify the transform animation in Motion, and just leave it as None, then during execution the time inside of the state seems to be ~1 second.

Obviously this is not an ideal use case, which is why I was surprised when even a single frame animation specified for Motion still resulted in an extended delay. The end goal is to specify an animation which could vary in length and the AnimationState will transition out when the animation is complete.

What is the expected behavior when an AnimationState only transitions out with HasExitTime=true and ExitTime=1 and Motion=None?

yes this is expected, a state without any motion has a duration of 1 second.

If you need a longer duration you can always modify AnimatiorState.speed.
The final length is clip duration / speed, so if you need a 10 second state just put 0.1 for speed

Also, is there any reason that a single frame animation would still default to the 1 second exit time? I tried to supply a single frame animation with the expectation that the state would be held for a single frame, but it still lasted 1 second.

As for extended duration when no Motion is specified, is it possible to adjust ExitTime such that the extended duration is achieved? So in your example, rather than adjusting AnimatorState.speed to 0.1, could I adjust ExitTime to 10?

Also to follow up … using an animation with 2 frames instead of a single frame animation seems to leave the state after 2 frames. So, again, the more interesting question is why a single frame animation still runs the default time of 1 second prior to exit.

Exit time greater than 1 are only meaningful for state with an animation clip with loop time ON, the interger part represent the number of loop. But in your case there is no animation clip so your only option is to change the speed.

Just did a few test, if your clip contain only one frame his length should be close to 0.01 and it should only play for 0.01 second. If your clip is playing for 1 second it probably because your clip length is also 1 second which mean that there is no animation inside your clip.

So If your clip length is not 1 second but mecanim play it for 1 second you should log a bug with your project so we can see what is going on.

Best regards,

1 Like