Learning Unity — How To Make A Loading Screen

Photo by Castorly Stock from Pexels

Getting started

The first thing we’ll need is two existing scenes to transition between. It would be helpful if one of these scenes had a lot of content to load, so that we can really see our progress bar at work. I will be using assets from The Great Fleece package, which is available at no cost from the Unity Asset Store.

Creating our background

Once we have our scene created, we’ll next want to give our players something to look at. In the scene, add a new UI Image object.

A new UI Image object in the Inspector window.
The UI Image object with the Anchor Presets menu opened.

Making the progress bar

Next we’ll create the progress bar. The idea here is to have a graphic on screen that will fill up over time to represent how much of the next scene has been loaded.

The UI Image object with the Image Type set to “Filled”.

Loading the loading screen scene

With the background and progress bar set, we’re now ready to do the scripting to switch us between scenes. Actually, make that almost ready.

The Build Settings window.

Wait, why are we learning this?

We’re building a load screen to get away from this direct method, aren’t we? Yes, that’s true. However, we can’t have a loading screen to another loading screen (well, I guess we could, but that would be ridiculous).

Loading the next scene

Ok, so now we have our loading screen, and we can get to our loading screen from some other scene. Now it’s time to put all the pieces together and load in that asset-heavy scene that takes some real time to load.

Completed script for the loading screen

Conclusion

That’s all there is to it. I suppose a loading screen doesn’t seem like it should be that difficult to implement, so it’s good that it is actually not difficult. Nevertheless, the value of that feedback to the player can not be overstated.

--

--

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