Function that starts on game startup but doesn't update on scene change.

Is it possible to have a function that doesn’t restart when scenes are changed and just starts once when the game is opened? I tried using Start() and Awake() but they update every time the scene is loaded.

Sure thing, just add DontDestroyOnLoad(gameObject) to the Awake() of the method you want to keep.

Keep in mind this will not destroy the script in other scenes, so you could end up with unwanted duplicates. To avoid that while keeping development simple, I use a singleton.

Thank you, I added this to a timer script I had made. Now that I have this It fixed my co-routine and everything is working now.