How to continue a function even when changing scenes

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

Hello

I have a script that starts timers for different tasks and i need these timers to run contentiously as when they expire they add resources to the player(gold, wood, iron). But when I change scenes the timers stops and no resources is added to the player.

Is there a way to run these timers even if i am not on the main scene?

Thanks in advance

:bust_in_silhouette: Reply From: LemonSqueezy

Maybe this is what you are looking for:
Global Script: Singletons (AutoLoad)