UEngine::GetWorldFromContextObject

Obtain a world object pointer from an object with has a world context.

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 * GetWorldFromContextObject
(
    const UObject * Object,
    EGetWorldErrorMode ErrorMode
) const

Remarks

Obtain a world object pointer from an object with has a world context.

Returns

The world to which the object belongs or nullptr if it cannot be found.

Parameters

Parameter

Description

Object

Object whose owning world we require.

ErrorMode

Controls what happens if the Object cannot be found

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