My game has a sprite representing a character. When the character picks up an item, the sprite should stop moving for a period of time.

I use CCbezier to make the sprite move, like this:


Now I want the sprite to stop its current action (moving) and later resume it. I can make the sprite stop by using:


but if I do that, I can't resume the movement. How can I do that?


2 Answers 2


You could try this:

[yourSprite pauseSchedulerAndActions]

and to resume

[yourSprite resumeSchedulerAndActions]

Source: SO thread

If that shouldn't work, another option might be:

[sprite.actionManager pauseTarget:sprite];

[sprite.actionManager resumeTarget:sprite];
  • 1
    \$\begingroup\$ [yourSprite pauseSchedulerAndActions] and to resume [yourSprite resumeSchedulerAndActions] These code pause all actions of sprite, i just want pause particular action of sprite, thanks \$\endgroup\$ Commented Jun 6, 2014 at 1:34

Yes, cocos2d-x has a built in way to do this. If you want to pause everything the character is doing you can simply use:




  • NOTE: this also pauses any actions being performed on the character. If you want to continue the actions, but just pause the animation, do this instead:

  • _scheduler is declared in the Node class, so all classes that inherit from it have access to it



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .