How to Create A Loading Scene in Unity

Objective: Create a new scene to show a loading bar while the actual game is loading.

The first step is to create a new scene. I called it “Load” and added the respective images, one for the background and another for the progress bar.

Now we have to change some properties in the progress bar images, the image type to “filled” and the filled method is “horizontal”.

With this configuration we can modify the value of the property “fill amount” and you can see how the bar moves forward and backward. We are gonna change the value of this property through code to show the loading progress.

I created a new script and added it to the canvas in the scene. Within the script I create a variable to store the reference of the progress bar image. Then I created a new coroutine to load the scene.

We have to create a variable of AsyncOperation type. It allows us to execute a function independently of the other processes and provides methods to check if the operation is done and the current progress. In this case we assigned the load scene to the variable and created a loop to check if the operation is done. While the operation is not done we just change the value of the filled amount of the progress bar to the current progress value.

Once the operation is done the game scene is going to be loaded.

And that’s it!!! We have a loading scene before the game.

--

--

--

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Decriminalization web OEM form 😂🤣 CI4 tag — this title came into my head blogging this article…

Managing a multi-site Cassandra cluster on multiple Kubernetes with CassKop / MultiCassKop

Power BI and the Speed(ier) Desktop

iPollo G1-Mini launch|Appreciate John Tromp’s spirit of “minimalism”

Universal way to write to external SD card on Android

Amazon EventBridge, HTTP API, Custom Domain… Complexity in simple words.

Plasma 5.24 is now available in Feren OS

AWS Specialty Certifications in the Data Space

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rusben Guzman

Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.

More from Medium

Unity new Input System : Useful Tips (Part VII)

Adding a wave system to our prototype

Creating a Moving Platform in Unity

Creating Rewarded Video Ads in Unity