Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Animation last keyframe does not add extra frame anymore

Discussion in 'Animation' started by huulong, Aug 21, 2022.

  1. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    206
    After upgrading to Unity 2022.1 I noticed that my animations, which used to show the frame after the last keyframe in light gray to indicate that the animation ended 1 frame later, were now displayed with the timeline highlight stopping right at the last keyframe.



    There are many discussions about the previous behavior of having an extra frame at the end, which required you to pay attention and put the last keyframe one frame earlier. And if you had an interpolated curve that needed looping, you had to first place the keyframe on frame N with the same value as the first frame for perfect looping anyway to generate the curve, then add a keypoint on frame N-1 to interpolate the pre-last value, then remove the keypoint at N (and hope that the portion looping between N-1 and the first frame is interpolated correctly).

    Said discussions' links:

    https://answers.unity.com/questions/1865538/animation-one-extra-frameanimation-frame.html
    https://answers.unity.com/questions/1705085/looping-animation-last-keyframe-adds-extra-frame.html
    https://forum.unity.com/threads/loo...be-duplicated-one-or-two-frames-later.770591/
    https://www.reddit.com/r/Unity3D/comments/icvztg/why_does_unity_add_an_extra_keyframe_to_my/

    Now, it seems that it stops right at the last frame, which makes things easier. My fear is that this update was done silently though, with no notification that the animations may slightly change, nor a checkbox to preserve the old behavior. The changelog doesn't mention it either: https://unity3d.com/unity/whats-new/2022.1.0

    Is it a simple cosmetic change, or have all animations really one frame fewer than before?
    Should we all update our existing animations?

    I'm trying to see with my own eyes if the extra frame has been cut or not. I have the impression that it's the case, but my perception is now 100% reliable either.

    EDIT: I don't have time right now, but if somebody can take a 60FPS capture of the same looping animation taken in Unity 2021 and 2022, maybe it would give us a clue.

    EDIT: I found a trick to see time more slowly: set Samples to 1 and you will clearly see that the animation loops right on the last keyframe!
     
    Last edited: Aug 21, 2022