RealDocs

UObject::GetTypedOuter

function CoreUObject Since 4.0
#include "UObject/UObjectBaseUtility.h"
Access: public

Description

Walks up the outer chain and returns the first object of type T, or null if none is found. Use this to find the owning actor or subsystem from a deeply nested subobject without storing an explicit back-pointer.

Signature

template<typename T> T* GetTypedOuter() const

Return Type

T*

Caveats & Gotchas

  • Returns null (not an assert) if no outer of the requested type exists. Always null-check.
  • Only searches upward through outers, not through actor component ownership or attachment hierarchies.
  • Performance is proportional to the depth of the outer chain — avoid in tight loops on deep hierarchies.

Example

Find the owning actor from a deep subobject C++
// Inside a data asset nested several outers deep
if (AActor* OwnerActor = GetTypedOuter<AActor>())
{
    OwnerActor->HandleDataUpdate();
}

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.