How to switch levels with a loading screen
Advanced Framework Pro switches levels with one call, Loading Switch Level, given the target PDA_Level. It fades every player to black, shows a loading transition while streaming maps load, and spawns the right pawn on arrival, in the editor, on a listen server and on clients alike. By the end of this you will have a button or trigger that takes the player to another level with a loading screen.
At a glance
Target PDA_Level
├─ Streaming Maps a non-empty list triggers the loading transition
├─ Transition Class = BP_Transition_Default, or your BP_Transition subclass
└─ Min Transition Time = 1–2 s
Any actor
└─ ML_Loading › Loading Switch Level Level = target PDA_Level, Listen Server = true / false
Custom screen: BP_Transition › Start Loading, Loading Finished
Current level: FL_Loading › getLevelInfo
Steps
- Describe each level in a
PDA_Level; see How to create a new level. - On the target level's data asset, set Transition Class to
BP_Transition_Default, or to your own subclass, and Min Transition Time to a second or two so fast loads do not flash. - List the level's streaming maps in Streaming Maps; a non-empty list is what triggers the loading transition.
- From any actor, call Loading Switch Level (
ML_Loading) with the target data asset. Pass Listen Server true when the host should keep the session open for others. - Test in the editor first, then in a packaged build, since the editor path opens the level directly while a build travels.
Notes
BP_Transition_Default is a dark studio: a dome lit by M_Loading_Backdrop, with a fine grid and a
soft pool of light under the player that both fade out with distance. WBP_Loading floats 1.5 m
in front of the player, follows the camera's height and shows the target level's name, an animated
sweep line and the word Loading. Its own post-process uses a fixed exposure, so the next level's
auto-exposure cannot brighten it. The camera fades in over 0.6 s and out over 0.5 s.
For your own loading screen derive from BP_Transition, override Start Loading and
Loading Finished, and name the class on the data asset. AFS_Core_Loading has no dependency on
AFS_UI, so a transition of yours can use any widget.
Call FL_Loading.getLevelInfo from anywhere to find out which level data asset is active, without
a hard reference.
On a listen server the switch uses servertravel, so every client follows; the shipped game mode
has seamless travel enabled.
The switch does nothing in the editor? Call the library; a hand-built travel URL keeps the play-in-editor prefix and fails.
Map_Examples_Lobby switches to every other example map through this system.