UEngine::GetCurrentPlayWorld

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

Choose your operating system:

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