This function changes the
AnimationTrack/Speed of an animation. A positive value for speed plays the animation forward, a negative one plays it backwards, and 0 pauses it.
An AnimationTrack’s initial speed is set as a parameter in
AnimationTrack/Play. However a track’s Speed can be changed during playback, using AdjustSpeed. When speed is equal to 1, the amount of time an animation takes to complete is equal to
AnimationTrack/Length (in seconds).
When is adjusted, then the actual time it will take a track to play can be computed by dividing the length by the speed. Speed is a unitless quantity.
Speed can be used to link the length of an animation to different gameplay events (for example recharging an ability) without having to upload different variants of the same animation.
The playback speed the animation is to be changed to.
In this example a player and an animation is loaded. The Length of an AnimationTrack determines how long the track would take to play if the speed is at 1. If the speed is adjusted, then the actual time it will take a track to play can be computed by dividing the length by the speed.
Playing Animation for a Specific Duration
The following function will play an AnimationTrack for a specific duration. This is done by changing the speed of the animation to the length of the animation divided by the desired playback duration. This could be used in situations where a developer wants to play a standard animation for different duration (for example, recharging different abilities).