Gap extrapolation refers to how an Animation track approximates animation data in the gaps before and after an Animation clip.
The main purpose for extrapolating animation data in the gaps between Animation clips is to avoid animation anomalies. Depending on the GameObject bound to the Animation track, these anomalies could be a GameObject jumping between two transformations, or a humanoid character jumping between different poses.
Each Animation clip has two gap extrapolation settings: pre-extrapolate, which controls how animation data is approximated in the gap before an Animation clip, and post-extrapolate, which controls how animation data extends in the gap after an Animation clip.
By default, both the pre-extrapolate and post-extrapolate settings are set to Hold. This sets the gap before the Animation clip to hold at the animation on the first frame, and the gap after the Animation clip to hold on the animation on the last frame. Icons before and after an Animation clip indicate the selected extrapolation modes.
To change the pre-extrapolate and post-extrapolate modes, select the Animation clip and use the Animation Extrapolation properties in the Inspector window.
If the selected Animation clip is the only clip on the Animation track, you can set the Pre-Extrapolate mode to one of the following options:
None: Turns off pre-extrapolation. In the gap before the selected Animation clip, the GameObject uses its transform, pose, or state from the scene. Selecting None is useful if, for example, you want to create an ease-in between the motion of a GameObject in the scene and an Animation clip. See Easing-in and Easing-out Clips for details.
Hold (default): In the gap before the selected Animation clip, the GameObject bound to the Animation track uses the values assigned at the start of the Animation clip.
Loop: In the gap before the selected Animation clip, the GameObject bound to the Animation track repeats the entire animation as a forward loop: from start to end. Use the Clip In property to offset the start of the loop.
Ping Pong: In the gap before the selected Animation clip, the GameObject bound to the Animation track repeats the entire animation forwards, then backwards. Use the Clip In property to offset the start of the loop. Changing the Clip In property affects the start of the loop, when looping forward, and the end of the loop, when looping backwards.
Continue: In the gap before the selected Animation clip, the GameObject bound to the Animation track either holds or loops the animation based on the settings of the source asset. For example, if the selected Animation clip uses the motion file “Recorded(2)” as its source asset and “Recorded(2)” is set to loop, then selecting Continue loops the animation according to the “Recorded(2)” Loop Time settings.
If the selected Animation clip is the only clip on the Animation track, you can set the Post-Extrapolate mode to one of the following options:
None: Turns off post-extrapolation. In the gap after the selected Animation clip, the GameObject uses its transform, pose, or state from the scene. Selecting None is useful if, for example, you want to create an ease-out between an Animation clip and the motion of a GameObject in the scene. See Easing-in and Easing-out Clips for details.
Hold (default): In the gap after the selected Animation clip, the GameObject bound to the Animation track uses the values assigned at the end of the Animation clip.
Loop: In the gap after the selected Animation clip, the GameObject bound to the Animation track repeats the entire animation as a forward loop: from start to end. Use the Clip In property to offset the start of the loop.
Ping Pong: In the gap after the selected Animation clip, the GameObject bound to the Animation track repeats the entire animation forwards, then backwards. Use the Clip In property to offset the start of the loop. Changing the Clip In property affects the start of the loop, when looping forward, and the end of the loop, when looping backwards.
Continue: In the gap after the selected Animation clip, the GameObject bound to the Animation track either holds or loops the animation based on the settings of the source asset. For example, if the selected Animation clip uses the motion file “Recorded(2)” as its source asset and “Recorded(2)” is set to loop, then selecting Continue loops the animation according to the “Recorded(2)” Loop Time settings.
When an Animation track contains a gap between two Animation clips, the Post-Extrapolate setting of the left clip sets the gap extrapolation. If the Post-Extrapolate setting of the clip to the left of a gap is set to None, the Pre-Extrapolate setting of the right clip sets the gap extrapolation. Icons before and after Animation clips indicate whether the extrapolation for a gap is taken from the Post-Extrapolate setting of the clip to the left or from the Pre-Extrapolate setting of the clip to the right.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.