Search Unity

The 1s Default Exit Time for single frame animations is confusing/misleading

Discussion in 'Animation' started by diesoftgames, May 2, 2022.

  1. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    122
    If an animation has a single keyframe in it, trying to transition to another animation state from this state with an Exit Time (which is supposed to be normalized time) of 1 specified will result in a 1 second delay before the transition occurs. I've also noticed when you add a new property to an otherwise empty animation, it defaults to have both a start and end keyframe at 0 and 1 seconds respectively, so I suspect these two things are related somehow.

    So this is a bit confusing because I always have to check the APIs that I'm not just confused and that Exit Time is in normalized time whenever I bump into this (not frequently so I always forget). But on top of that, there is a use case which is impossible: if I have a single frame animation which I want to play out only for that single frame before moving on, Exit Time of 1 won't work and it will play that single frame animation for an entire second. There is a workaround though for anyone bumping into this: if you simply set your framerate to double your desired single frame timing, and then give it two frames, Exit Time will work correctly.

    This seems like a bug to me, but there also seems to be a bit of deliberate-ness in how it is incorrect, so perhaps a dev can shed some light on this. Thanks!