UEngine::GetCurrentPlayWorld

Tries to find the currently active primary Game or Play in Editor world, returning null if it is ambiguous.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/Engine.h

Include

#include "Engine/Engine.h"

Source

/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp

Syntax

UWorld * GetCurrentPlayWorld
(
    UWorld * PossiblePlayWorld
) const

Remarks

Tries to find the currently active primary Game or Play in Editor world, returning null if it is ambiguous. This should only be called if you do not have a reliable world context object to use.

Returns

either nullptr or a World that is guaranteed to be of type Game or PIE

Parameters

Parameter

Description

PossiblePlayWorld

If set, this will be checked first and returned if valid. If this is not the active play world, null will be returned due to ambiguity

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss