Working with Unity Timeline
Understanding Pre and Post Extrapolation
When you select any two tracks within the Timeline, you will see that sometimes when you stitch together two different animations together, there will be an gap or space between them.
When you select these two, in the Inspector you will see that there is something called “Animation Extrapolation”. There is n Pre and Post Extrapolate and by default they should be set to “Hold”.
What this means is when the animation reach the end of the track, the animation would hold the last frame in position until the scrubber in the timeline reaches the next track.
There are several settings which we can use to alter the effects of the extrapolate. We have None, Hold, Loop, Ping Pong, and Continue.
Hold & None:
While at first None would seem to achieve a similar result to Hold, the main difference is that “Hold” would hold the last frame without movement while “None” would return to the first frame without movement.
Loop:
Looping would start the entire animation from start all over again once it reaches the end of the first track and will continuously loop until it has reached the second track.
Ping Pong:
Like Loop, Ping Pong would also repeat the current track but in reverse. Once it reaches the first frame of the animation then it will loop back forward. This will be on repeat until the timeline has reached the second track.
Continue:
Continue is an special one where the first track actually continues the animation of the second track even when there is a big gap between them. The only issue is once the scrubber reaches the second track the animation would again start from the second track.
Matching Two Animation Tracks in the Timeline:
Sometimes when you have two different animations in the timeline and you would like to match the offsets between the two, you either need to perfectly animate the sequence so they stitch together perfectly. Or you can use an function provided by Unity.
When you right click an animation track there is an function called “Match Offsets To Previous Clip” or “Match Offset to Next Clip” depending on if there is any animation tracks before and after the selected track.
It is a very similar function to easing in and out, but since this is all calculated by Unity it keeps the position of the object being animated.