Is there a way to always run scene 0 first in Editor?

So when I test my game on a device or standalone, scene 0 always gets loaded and ran first. For my scene 0, I have a scene called “FirstLoadedScene” where critical things are loaded/created before going into other scenes. Awesome.

Here’s the thing - I’ve got my game set up with a bunch of different scenes (main menu, level select, gameplay, etc.) Let’s say I want to work on the main menu scene. I load it in the editor, click on the editor/play button, and the main menu scene plays. BUT - it didn’t load that crucial “FirstLoadedScene” scene.

Anybody know of a way that I could always load the “FirstLoadedScene” when I hit play in the editor? Or what do you do to always load something before everything else in the editor?

Thanks!

It’s better not to rely on a separate scene to set everything up just for this very reason. You should be able to load necessary objects as you need them, it makes testing a lot easier.

Yah was going about it like that, but wanted to make sure. Thanks!

You can make a script with a bool “firstSceneLoaded”, attach it in every scene to a gameobject and set it to true when you load that scene. If it is false, use LoadLevelAdditive(“YourScene”)

1 Like