Jump to content

addAnimation()


photo

Recommended Posts

setAnimaion(0, 'path');

 

or

 

int id = addAnimaion( 'path guid');

setAnimation(0,id);

 

The results of these two methods look the same.

Why use addAnimation()?

 

 

Does play() function just run layer 0 animation?

Edited by dongju.jeong
Link to comment

Hello,

I would recommend using addAnimation("path.anim") when you need to work with a lot of animations on different layers and you don't know in advance which layer which animation is on. At the initialization stage, it is convenient to add all animations and remember their id. If in logic on one layer, depending on the states, there can be different animations, then it will be convenient to reassign them by id.

And yes, the play() function just plays the animation on layer 0.

  • Thanks 1
Link to comment

thank you.

 

When I try to apply the same animation to different types of objects,

Should I use the addAnimation() function individually?

For example

int aID = object1->addAnimation("anim1_run");     // object1 : soldier_Rifle
int aID2 = object2->addAnimation("anim1_run");         // object2 : soldier_RPG

Link to comment
×
×
  • Create New...