Game Development Reference
In-Depth Information
The animation time
The animation time is how far the animation has progressed in seconds. A key aspect that
must be noted is that looping animations will reset the animation's time whenever they
loop. Any decisions based on an animation's time must remember to handle loop anima-
tions and deal with the amount of time the animation is stepped for.
To determine whether an animation will complete a loop within an update loop, take the
animation's current time plus the amount the animation will be stepped for and see whether
the result is greater than the animation's length:
local timeInSeconds = Animation.GetTime(animation);
Animation.SetTime(animation, timeInSeconds);
Search WWH ::




Custom Search