GetAnimationPosition

Category: Animations
Since engine version: 1.0 OC

Description

Returns the position of the animation refered to by the given number. The returned value lies between 0 and GetAnimationLength(GetAnimationName(animation_number)). If there is no such animation with the given number or the number refers to a combination node then this function returns nil.

Syntax

int GetAnimationPosition(int animation_number, int attach_number);

Parameters

animation_number:
Animation number of the animation whose position to retrieve.
attach_number:
[opt] If given, refers to the number of the attached mesh to query instead of the object's main mesh.

Remark

See the animation documentation for further explanations of the animation system.

Example

SetAnimationPosition(animation_number, Anim_Const(GetAnimationPosition(animation_number)+100));
Script for a timer: For each call the animation is advanced by 100 milliseconds. If the timer is called periodically in same intervals Anim_Linear can be used instead.
See also: GetAnimationWeight, PlayAnimation, SetAnimationPosition, SetAnimationWeight
Clonk-Karl, 2010-01