Since engine version: 1.0 OC
Returns the length of the animation with the given name, or
nilif 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.
int GetAnimationLength(string animation, int attach_number);
- Name of the animation whose length to retrieve.
- [opt] If given, refers to the number of the attached mesh to query instead of the object's main mesh.
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.