Looping animation

Looping animation
0.0 0


Im trying to get my animation to loop but I can’t seem to find the solution. Done my fair share of googling but nothing i’ve found seems to work. As of now I have my CCAnimation run using runAction(), and before that I try to set animation->setLoops() to anything higher than one, but the animation still only plays once. Whats the best way to get a CCAnimation to loop indefinitely?



Mayby u should try to loop it in update method? Set loop counter from 0 to 10 and when it gets 10 change your animation frame (np: m_player->setDisplayFrameWithAnimationName(“PlayerAnimation”, X); X is int number of frame in your animation).


You can also wrap the animation action in CCRepeatForever.


CCRepeatForever was what i was looking for, thank you for the help!