Sitemap

Unity Load Scenes

2 min readMar 14, 2023

--

Loading scenes in Unity is an essential aspect of game development, as it allows you to navigate between different parts of your game, such as menus, levels, and game over screens.

The first step in loading scenes in Unity is to create a new scene. This can be done by going to the File menu and selecting “New Scene.” Once you have created a new scene, you can add objects, lights, and other elements to it to (make it look how you want) create the desired environment.

Press enter or click to view image in full size
Create New Scene

Load the new scene into the game by using SceneManager.LoadScene() function. This function takes one parameter, the name of the scene you want to load. For example, if you want to load a scene called “MainMenu,” use the following code: SceneManager.LoadScene(“MainMenu”);

Get Lana Elfstrom’s stories in your inbox

Join Medium for free to get updates from this writer.

You can also load scenes by their index in the build settings by passing an integer parameter to the SceneManager.LoadScene function. This can be useful if you want to load the next or previous scene in your game.

Press enter or click to view image in full size
Load Scene

Another way to load scenes is by using SceneManager.LoadSceneAsync() function which loads the scene in the background, so the player can still interact with the current scene while the new one is loading. This can be helpful for large or complex scenes.

Loading scenes in Unity is a fundamental aspect of game development. By using SceneManager.LoadScene() and SceneManager.LoadSceneAsync() functions, you can navigate between different parts of your game.

Remember to test your scenes and adjust as necessary to ensure that they load and transition smoothly.

--

--