How to Create a Loading Screen in Unity

Explaining how to create a Loading Screen

Gabe Gomez
3 min readJul 7, 2021

Objective: Make a loading screen for our stealth game.

Creating the Manager

To start, the first thing I did was create a class to handle my UI. This class is called the UIManager class. It is a singleton, and the code I used to implement it is below:

Notice how I also added methods to restart and quit the game. This is for when the player beats the game and for when they get caught by the guards or camera. In the GIF below I show how the restart works.

Making the Loading Screen

To begin with this, the first thing I did was create a new scene to act as our main menu scene. After some quick UI and animation, this is my main menu:

Now when we hit Start, it takes about 5–15 seconds to load the game scene. This is where the loading screen comes in handy. To create the loading screen, I created another scene to act as our loading screen. A quick setup led me to the screen we see below.

To get the progress bar working correctly, it was key to make sure I had the image type set to Filled as this allows me to control and show the load percentage.

To get this done, I had to utilize asynchronous calls from the SceneManager. This is the code in particular that got things working as I needed:

This is how things look when all put together:

With that, we have a loading screen. Thanks for reading today’s article! I’ll be releasing this project for people to check out soon!

--

--

No responses yet