Stop and start all tween

Hi,
I need help with stopping all tween when pause button is clicked and when play button is clicked it must restart.

@UnGamer What version of Creator are you using? Can you provide a demo that reproduces the problem? Or maybe you can refer to the documentations below first:

For Creator v2.x: https://docs.cocos.com/creator/api/en/classes/Tween.html#stopall
For Creator v3.0: https://docs.cocos.com/creator/3.0/api/en/classes/tween.tween-3.html#stopall

1 Like

Version is 2.4.3
Demo Iā€™m not sure how lets say I have 3 tween running on screen like player is constantly jumping, platforms are moving sideways and there are power-up fading in and out. I want to stop all 3 tween. I know I can stop them all using stopAll but is there something to start all tween or do I need to do it manually?

@UnGamer Maybe you can refer to this document: https://docs.cocos.com/creator/manual/en/scripting/tween.html

1 Like

Hi,
when the pause button clicked, pause the game using cc.director.pause() method, this will also going to stop all tween which is currently running.
when the play button clicked use cc.director.resume(), this will resume the game, and also all tweens.

1 Like

Thanks. its working.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.