/Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h
UActorComponentspecialization ofGetComponents()to avoid unnecessary casts. It's recommended to use TArrays with a TInlineAllocator to potentially avoid memory allocation costs.TInlineComponentArrayis defined to make this easier, for example: { TInlineComponentArrayPrimComponents; Actor->GetComponents(PrimComponents); }
template<class AllocatorType> void GetComponents ( [TArray](API\Runtime\Core\Containers\TArray)< [UActorComponent](API\Runtime\Engine\Components\UActorComponent) *, AllocatorType > & OutComponents, bool bIncludeFromChildActors ) const