Now Loading- Game Dev Series 76

Objective: create a loading screen in Unity

Loading screen is quite common in video games. It present the loading progress of upcoming scene.
In Unity, we can create a loading screen by using Asynchronous Operation.

In this article, we will create a simple loading screen by using Asynchronous Operation.

Create loading screen scene

Loading screen would be a bridge between the menu and main game scene. We can create a new scene, and create the background & loading bar from image objects. Adjust the loading bar to where you want to present the progress.

Check the Inspector of progress bar. Select Image Type from Simple to Filled, and set Fill Method to Horizontal.
You would see the Fill Amount value, which is from 0 to 1. This is what we are going to use in Asynchronous Operation.

Loading function

Create a new script and attach it to Canvas. First we need to create an Image variable to access the progress bar. And don’t forget to use the library of UI.

Inside Start(), let’s set the fill amount to 0. And start a coroutine as the load scene method.

In this coroutine, we will make it load the next scene by using Asynchronous Operation. And remember to use the library of SceneManager.

While the loading is not done yet, update the image fill with a while loop.

All done! With Asynchronous Operation, it would be easy to create a loading screen.
After load all the current scene in Build Setting, click Play and check the result.

My loading speed is too fast to check the result…

A passionate gamer whose goal is to work in video game development.