# SetAnimationWeight

Animations
5.1 OC
bool
int animation_number Animation number of the animation whose position to set.
array weight Specifies how to compute the weight of the animation in case the animation is combined with another animation in the given slot. The value needs to be created with one of the "Anim_" animation functions.
Sets a new weight for the given animation. Returns `true` if the new AVP was set or `false` if there is no such animation with the given number or the refernced node is an animation node.
See the animation documentation for further explanations of the animation system.
var angle = Angle(0, 0, GetXDir(), GetYDir()); if(angle > 360) angle = 360 - angle; SetAnimationWeight(swim_comb, Anim_Const(500+Cos(angle, 500)));
If swim_comb contains the number of an animation node combining a "swim up" and "swim down" animation (refer to the example of PlayAnimation), then this script sets the a weight depending on the cosine of the current swimming direction.
PlayAnimation
GetAnimationPosition
SetAnimationPosition
GetAnimationWeight
Anim_Const
Anim_Linear
Anim_X
Anim_Y
Anim_AbsX
Anim_AbsY
Anim_XDir
Anim_YDir
Anim_Action
Clonk-Karl
2010-01