Page 1 of 1

Changing Animations Using the Value of Animindex

PostPosted: Fri Feb 22, 2013 12:24 am
by bamby1983
Is there a way in which animations can be changed using the animindex value without explicitly stating the animation name within the ChangeAnimation function?

Re: Changing Animations Using the Value of Animindex

PostPosted: Fri Feb 22, 2013 1:18 am
by lcl
Yes there is. The function you want to use is getAnimName().
You give it the index of the animation and it returns the name of the animation with that index.
Code: Select all
ChangeAnimation("myActor", getAnimName(put your animindex here), FORWARD);

For more info about getAnimName() and other functions, check the Game Editor Script reference: http://game-editor.com/docs/script_reference.htm

Also, topics like this belong to the support forum, not the Game Editor Development forum. :)
It's not a crime to use wrong section of the forum. It's just that your posts will be noticed more easily from the support forum.

Re: Changing Animations Using the Value of Animindex

PostPosted: Fri Feb 22, 2013 1:24 am
by skydereign
The topic has been moved to its appropriate forum. But on a more related note, you'll notice that the getAnimName and getAnimIndex functions only work for the event actor. This has been fixed in future versions, but for now, if you need to use it for other actors, you'll have to use activation events.

Re: Changing Animations Using the Value of Animindex

PostPosted: Fri Feb 22, 2013 1:33 am
by bamby1983
Thanks for the quick response, guys!