Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am new to cocos2d. I am using CCAnimation. It's working fine, except I want to pause the animation occasionally. How do I do this?

Here's what I'm doing so far:

[mySprite runAction:[CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:walkAnim]]];

2 Answers 2

You can pause all the actions for a node, but not individually.

Basically you can do something like this

[[CCActionManager sharedManager] pauseTarget:node];

[[CCActionManager sharedManager] resumeTarget:node];

There's no pause per se. You can use stopAction or stopActionByTag to stop it and run it again when you want to resume.

Check the API here for these methods.


Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.