Choose your operating system:
Windows
macOS
Linux
For immersive apps in head-mounted displays (HMDs), you can use a texture as a loading screen to help with transitions between levels. At the end of this How-To, you will be familiar with the Blueprint nodes for loading screens and know how to add them to your project.
Set Loading Screen Node
The loading screen needs to be defined before you can show it in the HMD. On the Set Loading Screen node, you can add the texture that you want to use for the loading screen as a Texture Asset . Change the Offset vector to specify where the texture should appear relative to the position of the HMD.
Show and Hide Loading Screen Nodes
Once the loading screen has been set, call the Show Loading Screen node to display it in the headset. When you want the screen to no longer be displayed, call the Hide Loading Screen node. Sometimes it's necessary to add a small delay with the Delay node after Show Loading Screen to ensure the loading screen becomes visible before the next operation.
Using Loading Screen Nodes
In the following example, a map is loaded using Level Streaming as the map transition. Follow these general steps to add a loading screen to your project:
-
In the Unreal Editor , open your Map.
-
Click Blueprints > Open Level Blueprint .
-
In the Event Graph , add the following nodes:
-
Delay
-
Set Loading Screen
-
Show Loading Screen
-
Load Stream Level
-
Hide Loading Screen
-
-
Connect the output from the Event BeginPlay node to the input of the Set Loading Screen node.
-
On the Set Loading Screen node:
-
Add a texture to the Texture parameter.
-
Set the Scale 2D vector to (1.0, 1.0) —a nonzero value—to see the texture.
-
Set the Offset 3D vector for the loading screen to (1.0, 0.0, 0.5) . The loading screen should appear in front of you, but this position can be different depending on your headset.
-
-
Connect the output of the Set Loading Screen node to the input of the Show Loading Screen node.
-
Connect the output of the Show Loading Screen node to the input of the Delay node. The delay node will be used to set a specific time duration for the loading screen.
-
Set the Delay node's Duration parameter to 3.0 seconds to make the loading screen show for at least three seconds when you launch the app.
-
Connect the output from the Delay node to the input of the Load Stream Level node.
-
On the Load Stream Level node:
-
Set the Level Name parameter to a different map in your project.
-
Enable Make Visible After Load .
-
Enable Should Block on Load .
-
-
Connect the output of the Load Stream Level node to the input of the Hide Loading Screen node. Placing the Hide Loading Screen node after the Load Stream Level node ensures that the level is fully loaded before the user can see it.
-
Launch the level on your HMD to see the loading screen appear before the level changes.
You can also call Hide Loading Screen from Event BeginPlay in the Level Blueprint for the level you're loading next to ensure the loading screen isn't hidden until the level has finished loading. You won't need to enable Should Block on Load in the Load Stream Level node with this method.