Scene to scene in Unity

Johnmichaelluckett
2 min readSep 12, 2022

In video games, when one comes from the main menu or enters a door to another area or toggles to setting menu you are often transitioning between scenes. In Unity scene transition is often accomplished with

  • SceneManager.LoadScene(“Your-Scene-Here”)

To create scenes it is as easy right clicking and selecting the option

  • After your scene is created you can reference and switch to it with LoadScene. They should see your scene in the project folder.

As, you can see scenes are being loaded in my game —

  • Note make sure your scenes you want included with your game are in your build. You can do this by adding the scenes to your build in the build setting menu.

Further reading can be found here on LoadScene:

Now there is a lot under SceneManager if you look at the overall API

  • You use SetActiveScene() to change the status of scenes. This does not change the rendered scene but could be used to update a leaderboard or something.
  • CreateScene() could be used to create a entirely new scene from user input which might seem excessive for most but perhaps not for a sandbox game.
  • GetSceneAt() is helpful for cycling through an array of scenes to create menu where someone might cycle though fan made levels.

My point is while LoadScene() is probably the most used; SceneManager has all kinds of useful and handy functions to help solve many game challenges which likely won’t occur in my particular project but are worth knowing.

--

--