- Home /
Multiple scenes
Hi, I created 3 scenes on a unity project, how do I divide them? In the sense that when I start the play I must first activate the menu scene (1 scene), then the character selection scene (2 scenes) and then the game (3 scenes). Right now when I click on play I load all three scenes at the same time and I do not know why :(
Answer by Martin4851 · Jul 01, 2017 at 06:33 PM
You must add your scene to build Build Settings. (File -> Build Settings -> Scenes In Build).
The very first scene in your build settings is scene which will start when you open the app.
If you want to open new scene, do it like this:
using UnityEngine.SceneManagement; public void OpenMenuScene() { SceneManager.LoadScene("name_in_build_settings"); }
The parameter of the function must be the same as the name of the scene.
Answer by Ant10 · Jul 01, 2017 at 07:59 PM
Yes, in fact I added my scenes in build settings, but when I click on play I activate all 3 scenes at once, why? :(
I can see in your Hierarchy window that you have opened all 3 scenes. Just leave there the scene you want and on the others two scenes right click and choose Remove scene.
Your answer
Follow this Question
Related Questions
Using scene created with SceneManager.CreateScene during runtime 0 Answers
Most efficient way to transition between scenes? 1 Answer
One Location Game (with Scenes Loaded and Disabled) 0 Answers
Unity Scene loading problem (slow loading until it freezes) 0 Answers
Load Scene from .unity File 1 Answer