Are we there yet? — How to create a loading bar in Unity

Luke Duckett
2 min readJul 11, 2021

--

In this quick article I will go over how to create a loading bar in Unity.

I have a main menu scene built , with a background, title image and two buttons (start and quit). It will be the start button loads our loading screen scene (which is the scene in between the many and main game scenes).

On the loading screen I have created a simple script which calls the coroutine LoadingBarRoutine”. The coroutine changes has as variable assigned to the loading progress of the scene. We use the method LoadSceneAsync to achieve this. Every frame we pass the progress into the fill amount of our image and loop while the loading operation is not completed.

Remember to use the Unity Engine.SceneMangement namespace to get access to the scene management library

We can set up the images now in the scene. I have small scene prepared already with a background for the loading scene.

What we will do is an image to represent our progress bar and assign our loading progress to it.

All left to do is test it. Please note that the screen will load fairly quickly in this instance as the scene we are loading into isn’t too heavy on resources.

That’s all for now.

--

--

Luke Duckett
Luke Duckett

Written by Luke Duckett

🎮 First Nations Unity Dev from Wonnarua country 🏞️ | From Player to Lifelong Learner: Crafting Games, Debugging Code, and Embracing New Technology

No responses yet