Loading Scenes in Unity

Unity has made it easy for us developers to load scenes, which is pretty important. Sure you could do everything in one single scene, but that might be more trouble than it’s worth.

To be able to load scenes we have to import the namespace with the required methods, UnityEngine.SceneMangement. The name is pretty obvious, which is good! To load a scene is pretty straightforward. Simply use the LoadScene method in the SceneManager namespace.

One thing to note: to be able to load a scene it has to be present in the project's build settings.

The LoadScene method can take either the name of the scene or the number it has in the build settings.

Isn’t it great how Unity has given us tools to make creating games easier? 😀



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store