How to Create A Loading Scene in Unity

Stealth Game & Cinematography

Objective: Create a loading screen

To create a loading screen, you need to create a new scene and add UI to make it look good.

We add the background image, progress bar which we will be changing its values to make it look like it is filling the bar.

Create a new script for loading, I name it LoadLevel and drag it inside the canvas.

Now inside the script, create a variable which we will be using to change the value of progress bar and start a coroutine to start the loading process.

Now inside the coroutine, start a AsyncOperation to start loading the Main scene. then we loop until the Main scene is completed loading.

Inside the loop, we change the value of fillAmount inside the progress bar to same as the progress of the loading main.

We do this because the progress value is between 0–1 which is the same for fill amount.

We wait for the end of the frame to start loop again if the progress is still on going.

This is how it will look like.

Unity Developer