RealDocs

UGameplayStatics::GetStreamingLevel

function Engine Blueprint Since 4.0
#include "Kismet/GameplayStatics.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Returns the ULevelStreaming object for a given level package name, allowing you to inspect or modify streaming state, visibility, and load status at runtime.

Caveats & Gotchas

  • PackageName must be the full package path (e.g. '/Game/Levels/MySubLevel'), not the short name used by LoadStreamLevel. Passing a short name returns null.
  • Returns null if the level is not listed in the world's streaming level array, even if a level with that name exists in the content browser. The level must have been added to the persistent level's streaming list in the editor.
  • The returned ULevelStreaming pointer is only valid as long as the streaming level exists. Do not cache it across level transitions.

Signature

static ENGINE_API class ULevelStreaming* GetStreamingLevel(const UObject* WorldContextObject, FName PackageName);

Parameters

Name Type Description Default
WorldContextObject const UObject* Any object in the world to use as context.
PackageName FName The package name of the streaming level (e.g. '/Game/Levels/MySubLevel').

Return Type

ULevelStreaming*

Example

Check whether a streaming level is currently loaded and visible C++
ULevelStreaming* StreamingLevel = UGameplayStatics::GetStreamingLevel(this, FName("/Game/Levels/MySubLevel"));
if (StreamingLevel && StreamingLevel->IsLevelLoaded())
{
    UE_LOG(LogGame, Log, TEXT("Level is loaded, visible: %d"), StreamingLevel->IsLevelVisible());
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.