Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/GameFramework > API/Runtime/Engine/GameFramework/AActor > API/Runtime/Engine/GameFramework/AActor/GetActorClassDefaultComponent
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h |
| Include | #include "GameFramework/Actor.h" |
| Source | /Engine/Source/Runtime/Engine/Private/Actor.cpp |
static const UActorComponent * GetActorClassDefaultComponent
(
const TSubclassOf < AActor > & InActorClass,
const TSubclassOf < UActorComponent > & InComponentClass
)
Remarks
Fetches the first component of ActorClass's CDO which match the requested component class. Will include the components added via the BP editor (which AActor.GetComponents fails to do for CDOs).
Parameters
| Name | Description |
|---|---|
| InActorClass | Class of AActor for which we will retrieve all components. |
| InComponentClass | Only retrieve components of this type. |
| OutComponents | this is where the found components will end up. Note that the preexisting contents of OutComponents will get overridden. |