0
0
Unityframework~10 mins

Build settings and scene order in Unity - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Build settings and scene order
Open Build Settings
Add Scenes to Build
Arrange Scene Order
Set First Scene as Entry
Build and Run Game
Game Starts
This flow shows how you open build settings, add scenes, arrange their order, set the first scene, and then build and run the game.
Execution Sample
Unity
// Pseudocode for setting build scenes order
var buildScenes = new List<Scene>()
buildScenes.Add(scene1)
buildScenes.Add(scene2)
// scene1 is first, scene2 second
BuildPlayer(buildScenes);
This code adds scenes to the build list in order and builds the player with that order.
Execution Table
StepActionScene List OrderFirst Scene (Entry Point)Result
1Open Build Settings window[]NoneBuild Settings window opens
2Add Scene1 to build[Scene1]Scene1Scene1 added, becomes first scene
3Add Scene2 to build[Scene1, Scene2]Scene1Scene2 added after Scene1
4Rearrange scenes: move Scene2 up[Scene2, Scene1]Scene2Scene2 is now first scene
5Build and run game[Scene2, Scene1]Scene2Game starts with Scene2
6Exit[Scene2, Scene1]Scene2Build complete, game launched
💡 Build and run completes, game starts with first scene in list
Variable Tracker
VariableStartAfter Step 2After Step 3After Step 4Final
Scene List[][Scene1][Scene1, Scene2][Scene2, Scene1][Scene2, Scene1]
First SceneNoneScene1Scene1Scene2Scene2
Key Moments - 3 Insights
Why does the first scene in the list become the entry point of the game?
Because Unity always starts the game with the first scene listed in Build Settings, as shown in steps 2 and 4 where changing order changes the entry scene.
What happens if you add scenes but don't arrange their order?
The scenes run in the order they were added, so the first added scene is the entry point, as seen in steps 2 and 3.
Can you start the game with a scene not in the build list?
No, only scenes included in the build settings list can be used to start the game, otherwise the build will fail or skip that scene.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, which scene is the entry point after step 4?
AScene2
BScene1
CNo scene
DBoth scenes
💡 Hint
Check the 'First Scene (Entry Point)' column at step 4 in the execution table.
At which step does Scene2 get added to the build list?
AStep 1
BStep 2
CStep 3
DStep 4
💡 Hint
Look at the 'Action' column for when Scene2 is added in the execution table.
If you remove Scene1 after step 3, what will be the first scene?
AScene1
BScene2
CNo scene
DScene3
💡 Hint
Refer to the variable_tracker for scene list changes and first scene after removing Scene1.
Concept Snapshot
Build Settings and Scene Order in Unity:
- Open Build Settings window
- Add scenes to the build list
- Arrange scenes to set game start order
- First scene in list is entry point
- Build and run starts game from first scene
Full Transcript
In Unity, you open the Build Settings window to manage which scenes are included in your game build. You add scenes to the build list, and the order of these scenes determines which scene starts first when the game runs. The first scene in the list is the entry point. You can rearrange scenes to change the starting scene. After setting the scenes and order, you build and run the game, which launches starting from the first scene in the list.