AActor::GetComponents

[UActorComponent](API\Runtime\Engine\Components\UActorComponent) specialization of [GetComponents()](API\Runtime\Engine\GameFramework\AActor\GetComponents\2) to avoid unnecessary casts.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h

Include

#include "GameFramework/Actor.h"

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

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback