UGameplayStatics::FlushLevelStreaming
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Blocks the game thread until all pending level streaming operations (loads, unloads, visibility changes) are fully complete. Used to guarantee a clean streaming state before a cutscene or gameplay event.
Caveats & Gotchas
- • This function blocks the game thread entirely — it will cause a hard frame hitch proportional to the total remaining streaming work. Never call it during normal gameplay; restrict it to loading screens or cinematic transitions.
- • Does not cancel in-flight async I/O; it simply spins the streaming system until all queued state changes are resolved. On large open worlds with many streaming levels this can take several seconds.
- • Calling FlushLevelStreaming while a level transition (OpenLevel) is already in progress has undefined behaviour — the travel may complete before flushing finishes, leaving the streaming system in an unexpected state.
Signature
static ENGINE_API void FlushLevelStreaming(const UObject* WorldContextObject); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Any object in the world to use as context. | — |
Return Type
void Example
Guarantee all levels are loaded before starting a cutscene C++
// Trigger all desired level loads first
UGameplayStatics::LoadStreamLevel(this, FName("BossArena"), true, false, LatentInfo);
// Then flush to ensure they are ready before the cutscene starts
UGameplayStatics::FlushLevelStreaming(this);
StartCutscene(); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?