AFS_Core_Loading
Level flow: the level data asset, game mode, transition actors, player start positions and the libraries that switch levels in editor, listen-server and client contexts.
What it gives you
- One data asset describing a level's game mode, pawns and maps
- Correct level switching in editor, on a listen server and on clients
- Customisable loading transitions
- Indexed player start positions for multiplayer
Requires
Required by
Description
PDA_Level is the centre of this plugin. It names the game mode, the pawn class per platform, the
persistent map, any streaming maps, the transition actor and a minimum transition time. Because the
pawn decision lives here rather than in the map, the same map can serve VR, desktop and mobile.
ML_Loading.Loading_SwitchLevel handles the three cases that usually get written three times: in the
editor it fades and calls OpenLevel; with authority it fades every player and issues a
servertravel; on a client it fades and opens locally.
FL_Loading caches the active level data asset in the object registry subsystem, so any Blueprint
can ask what level it is in without a hard reference.
Setup
See Create a new level for the full walkthrough.
- Create a
PDA_Leveland fill in the game mode, pawn classes and maps. - Place a
BP_MapInfoactor in the map pointing at the data asset. - Place
BP_PlayerPositionactors as spawn points; mark one Default Position.
Usage
Switching level
Call ML_Loading.Loading_SwitchLevel with the target PDA_Level. Pass Listen Server true when
the host should stay listening.
Customising the loading screen
Derive from BP_Transition, override StartLoading and LoadingFinished, and set your class as
Transition Class on the level data asset.
Finding the current level
Call FL_Loading.getLevelInfo from anywhere.
Key properties
| Property | When to change |
|---|---|
Pawn Select | Force Desktop while iterating; Dynamic for shipping |
Min Transition Time | Raise to avoid a jarring flash when loading is fast |
Streaming Maps | Fill only when you actually stream; a non-empty list triggers the loading transition |
Player Index / Default Position | On BP_PlayerPosition, for multiplayer spawn assignment |
Extending
Derive from BP_Transition for custom loading visuals, and implement BPI_PlayerPosition to make your own actor a valid spawn point.
Multiplayer notes
Level switching on a listen server uses servertravel so all clients follow. bUseSeamlessTravel is enabled on the shipped game mode.
Example map
Map_Examples_Lobby switches between every other example map using this system.
Troubleshooting
The wrong pawn spawns. Pawn Select is set to a Force option, or the map has no BP_MapInfo.
Level switch does nothing in the editor. The editor path strips the play-in-editor prefix via
getLevelPathFromReference; a manually built travel URL will not.
API reference
Every blueprint asset in this plugin. Expand an asset to see its members.
Blueprints/MapInfo
BP_MapInfo1 members
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | LevelKeyInfo | PDA_Level | The level data asset describing this map. Place one Map Info actor per level so any Blueprint can discover the level's configuration. |
Blueprints/PlayerPosition
BP_PlayerPosition7 members
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | PlayerIndexParameter | int | Which player this start position belongs to. Positions are claimed in order, so give each start a distinct index for multiplayer. |
| var | DefaultPositionParameter | bool | Marks this as the fallback start used when no position matches the joining player's index. |
| var | Use FadeSettings | E_Teleport_Fade | Whether teleporting a player to this position fades the camera. |
| fn | FindFreeIndexParameter | () | Claims the next unused player index for this position. |
| event | OnTeleportFinished_Event | (Pawn: Pawn) | Internal handler fired once a pawn has finished teleporting to this position. |
| event | PlayerPosition_TeleportToPosition | (Pawn: Pawn) | Teleports the given pawn to this start position. |
| event | PlayerPosition_PawnSpawnedHere | (Pawn: Pawn) | Called when a pawn spawns at this position, so the start can run any arrival logic. |
Blueprints/Transition
BP_Transition2 members
| Kind | Name | Signature | Description |
|---|---|---|---|
| event | LoadingFinished | () | Called when loading completes and the minimum transition time has elapsed. Override to dismiss your loading visuals. |
| event | StartLoading | () | Called when loading begins. Override in a subclass to show your own loading visuals. |
BP_Transition_Default2 members
| Kind | Name | Signature | Description |
|---|---|---|---|
| event | LoadingFinished | () | Fades out the default loading screen and destroys the transition actor. |
| event | StartLoading | () | Shows the default loading screen and begins its animation. |
DataAssets
PDA_Level11 members
| Kind | Name | Signature | Description |
|---|---|---|---|
| var | GameModePawn | Class<GameMode> | Game mode loaded with this level. Passed on the travel URL so it applies to networked travel as well. |
| var | PawnSelectPawn | E_Pawn_Select | How the pawn is chosen. Dynamic detects VR, then mobile, then desktop; the Force options override that for testing. |
| var | Default_Pawn_DesktopPawn | Class<Pawn> | Pawn class possessed when the level is entered on a desktop machine. Only consulted when Pawn Select resolves to desktop; leave it empty and the level loads with no pawn on that platform. |
| var | Default_Pawn_VRPawn | Class<Pawn> | Pawn class spawned when a head-mounted display is present. |
| var | Default_Pawn_MobilePawn | Class<Pawn> | Pawn class spawned on iOS and Android. |
| var | NameInformation | text | Display name for this level, shown in navigation and loading UI. |
| var | TransitionClassTransition | Class<BP_Transition> | Transition actor spawned while streaming maps load. Subclass it to customise the loading screen. |
| var | MinTransitionTimeTransition | float | Shortest time the loading screen stays up, in seconds. Prevents a jarring flash when loading is fast. |
| var | PersistantMapStreaming Level | SoftWorldReference | The map opened immediately when switching to this level. |
| var | StreamingMapsStreaming Level | SoftWorldReference[] | Maps streamed in after the persistent map opens. If this list is non-empty a loading transition is shown while they load. |
| fn | getPawnToSpawn | (out PawnToSpawn: Class<Pawn>) | Resolves which pawn class to spawn, applying the Pawn Select rule against the current platform. |
Game
BP_GameMode0 members
No editor-visible members; this asset configures defaults only.
Helper
BP_Helper_Pawn_Loading8 members
| Kind | Name | Signature | Description |
|---|---|---|---|
| fn | RequiresLoading | (out RequiresLoading: bool) | Returns whether this level still has streaming maps to load before gameplay can begin. |
| fn | FindStartingPlayerPosition | (PlayerIndex: int, out PlayerPosition: Actor) | Finds the player start matching the given index, falling back to the default position. |
| event | Server_ControllerReady | (Controller: PlayerController) | Tells the server this client's controller is ready, so the real pawn can be spawned. |
| event | Client_LoadLevels | (Level: PDA_Level) | Instructs this client to stream in the level's maps and show the transition while it happens. |
| event | ControllerChanged | (OldController: Controller, NewController: Controller) | Internal handler that reacts to this placeholder pawn being possessed or unpossessed. |
| event | Server_LoadLevelInfo | () | Asks the server for the level data asset so the client knows what to load. |
| event | CheckForUnpossess | (Controller: Controller) | Checks whether this placeholder pawn is still needed and destroys it once the real pawn has taken over. |
| event | Server_DestroyPawn | () | Asks the server to destroy this placeholder pawn. |
Interfaces
BPI_PlayerPosition5 members
| Kind | Name | Signature | Description |
|---|---|---|---|
| fn | PlayerPosition_getSpawnTransformPlayer Position | (out Transform: Transform) | Returns the transform a pawn should spawn at for this position. |
| fn | PlayerPosition_getIndexPlayer Position | (out Index: int) | Returns the player index this position is reserved for. |
| fn | PlayerPosition_IsDefaultPlayer Position | (out Default: bool) | Returns whether this is the fallback position used when no index matches. |
| fn | PlayerPosition_TeleportToPositionPlayer Position | (Pawn: Pawn) | Teleports the given pawn to this position. |
| fn | PlayerPosition_PawnSpawnedHerePlayer Position | (Pawn: Pawn) | Notifies the position that a pawn has spawned there. |
Libraries
FL_Loading3 members
| Kind | Name | Signature | Description |
|---|---|---|---|
| fn | getLevelInfoLevelInfo | (const Context: Object, __WorldContext: Object, out Level: PDA_Level) | Returns the level data asset for the current level, reading it from the object registry and falling back to the Map Info actor placed in the map. |
| fn | setLevelInfoLevel Info | (Context: Object, Level: PDA_Level, __WorldContext: Object) | Stores the level data asset in the object registry so later lookups avoid searching the level. |
| fn | getLevelPathFromReferenceLevel | (const Level: SoftObject<World>, __WorldContext: Object, out LevelPath: name) | Converts a soft world reference into a travel path, stripping the editor play-in-editor prefix so server travel works from the editor. |
ML_Comp_Loading0 members
No editor-visible members; this asset configures defaults only.
ML_Loading0 members
No editor-visible members; this asset configures defaults only.
Widgets
WBP_Loading0 members
No editor-visible members; this asset configures defaults only.