AActor::GetComponents

Syntax

template<class AllocatorType>
void GetComponents
(
    TArray < UActorComponent *, AllocatorType > & OutComponents,
    bool bIncludeFromChildActors
) const

Remarks

UActorComponent specialization of GetComponents() to avoid unnecessary casts. It's recommended to use TArrays with a TInlineAllocator to potentially avoid memory allocation costs. TInlineComponentArray is defined to make this easier, for example: { TInlineComponentArray PrimComponents; Actor->GetComponents(PrimComponents); }

Parameters

Parameter

Description

bIncludeFromChildActors

If true then recurse in to ChildActor components and find components of the appropriate type in those Actors as well

References

Module

Engine

Header

Runtime/Engine/Classes/GameFramework/Actor.h