Timer is not reset when scene changed!I used SceneManager

I found that when I pressed retry button (scene:changeScene(“currentScene”,“fade”))
then my timer count did not start count from one but start count from the point that I quit from the scene.

However, I found that if I go to another scene and back to currentScene , everything is fine.

What is cause my problem?
[import]uid: 65906 topic_id: 18338 reply_id: 318338[/import]

We don’t provide support for SceneManager as it is a third party class, however hopefully Danny will see this thread and be able to offer some insight. (Danny created SceneManager.)

If you continue to have issues and cannot resolve them I’d encourage you to checkout storyboard, it’s available in recent daily builds.

Peach :slight_smile: [import]uid: 52491 topic_id: 18338 reply_id: 70275[/import]

Thanks for your reply, Peach.
Actually, I did not think scene manager is the main problem.
I just really want to know that if it possible to reset timer or not since I checked on api document and I cannot find timer.reset or something that is similar to. I think I may use another logic to solve the problem. But I still want to understand the api more for my future project.

One more question, storyboard means daily build summary? [import]uid: 65906 topic_id: 18338 reply_id: 70366[/import]

Hey,

Well, you can cancel the timer using timer.cancel(timerName) then start it again the same way you originally created it. Make sense?

Storyboard is like Director or SceneManager but is make by Ansca :slight_smile:

Peach [import]uid: 52491 topic_id: 18338 reply_id: 70487[/import]

If your still using scene manager.

Are you using the latest version and creating your timers via the new features i added (ie scene:createTimer) ?

If so when changing scenes call (in your cleanup function) :

scene:cancelAllTimers() [import]uid: 84637 topic_id: 18338 reply_id: 70905[/import]

Thanks you. (^_^) I am really love cleanup function.
(Peach, your way is work too!) [import]uid: 65906 topic_id: 18338 reply_id: 71213[/import]