How to get from another scene to another using Unity Scene Management?
In this article, we will see how Unity Scene Management works and how to load a scene in 3 different ways.
Scene Management
Every game has more than one scene. There’s a game scene, main menu and there can be game over scene too. Or if you have an apartment or house where you can enter, that can be a scene too.
How we manage that the player goes to that certain scene? There are few options you have.
To make Scene Management easier you should have different scripts to control different transitions. For example, Main Menu has MainMenuManager Script. This makes it easier for you to find your script for Main Menu. :)
But before we load anything we must have the
using UnityEngine.SceneManagement;
Here are 3 ways to load a scene.
- Load Scene which has buildIndex 1
2. Load Scene by the name, in this case, we load scene “Game”
3. Get your active scene and add 1 to your buildIndex
Awesome! There’s 3 where to choose from :)
Thank you for reading once again!