How can I continue a timer when I switch a scene?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jujumumu

If I upgrade a building in my game and it takes 20 minutes I store the time when it would finish upgrading in a singleton. Then when I go back to the scene and the time is less than the stored time I would set the timer for the remaining time. If it time was bigger than the time I would just upgrade it. The problem is that I want like a notification for when it finishes even if I am in the other scenes. How can I do this?

:bust_in_silhouette: Reply From: RedBlueCarrots

I suggest that you have a timer as the singleton rather than just storing a value.

(This might not answer your question very well I’m pretty inexperienced.)

This is what I thought to do but I am going to have multiple upgrades running in the future so that would not work.

jujumumu | 2019-11-15 03:08