UGameplayStatics::LoadStreamLevel
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Asynchronously streams a sub-level into the world by name. Calling this again before the load finishes has no effect. The completion callback fires when the level is fully loaded (and visible, if requested).
Caveats & Gotchas
- • The LevelName must match the short package name exactly as it appears in the World Composition or level list — using a full package path or relative path will silently fail to find the level.
- • Setting bShouldBlockOnLoad to true will freeze the game thread until loading completes, causing a visible hitch. Only use this during initial load screens or cinematics.
- • In Blueprint this is a latent node; in C++ the LatentInfo callback fires on the same thread but in a deferred manner — do not assume the level is available on the line immediately after the call.
- • If the level is already loaded, the callback fires immediately but no second load is initiated.
Signature
static ENGINE_API void LoadStreamLevel(const UObject* WorldContextObject, FName LevelName, bool bMakeVisibleAfterLoad, bool bShouldBlockOnLoad, FLatentActionInfo LatentInfo); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Any object in the world to use as context. | — |
| LevelName | FName | The short name of the level to stream in (e.g. 'MySubLevel'), not the full package path. | — |
| bMakeVisibleAfterLoad | bool | If true, the level is made visible immediately after loading completes. | — |
| bShouldBlockOnLoad | bool | If true, the game thread blocks until the level is fully loaded. Causes a hitch. | — |
| LatentInfo | FLatentActionInfo | Latent action callback info used by Blueprint to resume execution after load completes. | — |
Return Type
void Example
Async stream in a sub-level from C++ C++
FLatentActionInfo LatentInfo;
LatentInfo.CallbackTarget = this;
LatentInfo.ExecutionFunction = FName("OnLevelLoaded");
LatentInfo.Linkage = 0;
LatentInfo.UUID = 1;
UGameplayStatics::LoadStreamLevel(this, FName("MySubLevel"), true, false, LatentInfo); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?