- Home /
Set first scene
Hi this must be really simple but I can't find it. I have created my game and now I'm adding a main menu start screen but when I build it always starts on the game screen.
How do I set which scene the first which is loaded on start up?
Answer by DaveA · Jan 28, 2011 at 01:31 AM
In the Build Settings, from the File menu, you can reorder your scenes. Make sure startup is at the top of the list.
Just to add, use the mouse to drag and drop the scenes within in the list. It isn't obvious from the UI thats what you have to do on the Build Settings screen.
If you need to remove a scene from the list, pick one and press delete. It was not obvious for me :)
Another "not so obvious for me" tip: You actually can drag and drop all scenes at once to Scenes In Build ..you dont need to load scene, goto build settings and click Add Current. Thats how i did it until yesterday :)
@DaveA This doesn´t work for me... And other advice?
Go to Build Settings. Click and drag the scenes into the correct order, with your main menu scene at the top. Order them according to them numbers. For instance, your main menu should be number 0, etc. Add all of your levels to the build settings and save. Then build and test.
Like so:
Answer by bastischo · Mar 10, 2016 at 09:11 AM
The Order in Build Settings doesn't affect the Play Button at all. It is only for when you actually Build/Export your Game.
Is there a way to affect the play button? I want it to always load a default scene
Double clicking on a Scene to make it the base scene seemed to work for me (which will make its name bold). however, no idea how to change the order of the rest of the scenes.
To temporary change the Play button`s first scene if u want to test another one: If double clicking doesnt work, u can disable other scenes with right click unload.
Old thread, but for newcomers to unity:
The best way (imo) to load a specific scene on a button press is to create a menu item or editor window that can load it for you (there is also a really nice editor addon to add buttons next to play that I will edit in here later if i can find it).
For example: The game im working on has multiple platforms. iOS, Android, PC, Quest, etc. We have different scenes for each, so I want a system to load the correct scene and then navigate to the proper platform, and play.
Platform currentPlatform; //Set this in your UI, or retrieve from a gameobject, etc.
private static void LoadAppropriate () {
string current = EditorScene$$anonymous$$anager.GetActiveScene().name;
string targetPlatform = currentPlatform.ToString().ToLower();
if (!current.Contains(targetPlatform)) { //Dont need to load it if we're already there
EditorScene$$anonymous$$anager.OpenScene(String.Format("Assets/Scenes/scene_01_{0}.unity", targetPlatform));
}
EditorApplication.isPlaying = true;
}
This is not the system we're using, (we use editor coroutines to wait for scene load for instance), but its the outline. Unity is a very good engine, but for it to be perfect for you, you will end up making your own tools.
Answer by ajayajayaj · Oct 02, 2017 at 04:14 PM
If you have a NetworkManager, you must move that to the scene you want to be default. The default scene will be set to the scene with the NetworkManager regardless of the build settings.
Answer by spktools_com · Dec 20, 2020 at 07:59 PM
It makes no sense at all that it's still like this..