GetObjectsOfClass

Returns an array of objects of a specific class.

Windows
MacOS
Linux

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectHash.h

Include

#include "UObject/UObjectHash.h"

Source

/Engine/Source/Runtime/CoreUObject/Private/UObject/UObjectHash.cpp

Syntax

void GetObjectsOfClass
(
    const UClass * ClassToLookFor,
    TArray< UObject * > & Results,
    bool bIncludeDerivedClasses,
    EObjectFlags ExcludeFlags,
    EInternalObjectFlags ExclusionInternalFlags
)

Remarks

Returns an array of objects of a specific class. Optionally, results can include objects of derived classes as well.

Parameters

Parameter

Description

ClassToLookFor

Class of the objects to return.

Results

An output list of objects of the specified class.

bIncludeDerivedClasses

If true, the results will include objects of child classes as well.

AdditionalExcludeFlags

Objects with any of these flags will be excluded from the results.

ExclusiveInternalFlags

Specifies internal flags to use as a filter for which objects to return

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