Simple loading screen in Unity

Niklas Bergstrand
3 min readJun 4, 2021

Most games will have a loading screen between scenes to show the progress before revealing the next scene. Let’s go over how to implement this:

First, add a UI Image that will act as the progress bar. Select the source image and then set image type to filled. Set fill method to horizontal:

Position the progress bar. You can see what it will look like by adjusting the fill amount:

Create a script to handle the progress bar and also load the next scene. You can add this script to any other game object:

Open up the script. Add two using statements, UnityEngine.UI and UnityEngine.SceneManagement. Add a serialized Image for the progress bar:

Create a coroutine called LoadNextLevel. Call the function Scenemanager.LoadAsync(“SceneName”) which will start to load the next seen in the background. This function will return an AsyncOperation which keeps track on the progress. Add a while loop which will run until the scene has finished loading. As Unity shows the load progress from 0.0 to 0.9 (the last 0.1 is for activating the scene) we need to use a bit of math to ensure the loading bar gets filled all the way:

Call the coroutine from the Start function:

Lastly, drag the progress bar image onto the script on the Inspector:

Good luck!

--

--