# GetAnimationLength

Animations
5.1 OC
int
string animation Name of the animation whose length to retrieve.
Returns the length of the animation with the given name, or `nil` if there is no such animation. Valid positions (for PlayAnimation and SetAnimationPosition) include values between 0 and the animation length. The returned number corresponds to the animation length (as specified in the modelling tool) in milliseconds.
See the animation documentation for further explanations of the animation system.
PlayAnimation
("Turn", 5, Anim_Linear(0, 0, GetAnimationLength("Turn"), 50, ANIM_Loop), Anim_Const(1000));
Plays a new animation named "Turn" in slot 5 which superimposes other animations in slot 5. One animation cycle lasts 50 frames. After that time the animation restarts from the beginning.
PlayAnimation
SetAnimationPosition
Clonk-Karl
2010-01