Navigation
API > API/Runtime > API/Runtime/Engine
A component that spawns an Actor when registered, and destroys it when unregistered.
| Name | UChildActorComponent |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Components/ChildActorComponent.h |
| Include Path | #include "Components/ChildActorComponent.h" |
Syntax
UCLASS (ClassGroup=Utility,
HideCategories=(Object, LOD, Physics, Lighting, TextureStreaming, Activation, "Components|Activation", Collision),
Meta=(BlueprintSpawnableComponent), MinimalAPI)
class UChildActorComponent : public USceneComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → UChildActorComponent
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UChildActorComponent
(
const FObjectInitializer& ObjectInitializer |
Components/ChildActorComponent.h |
Classes
| Name | Remarks |
|---|---|
| FOnChildActorCreated |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActorOuter | UObject * | Detect when the parent actor is renamed, in which case we can't preserve the child actor's name | Components/ChildActorComponent.h | |
| bChildActorIsTransient | uint8 | Should the spawned actor be marked as transient? | Components/ChildActorComponent.h |
|
| bChildActorNameIsExact | uint8 | When true, does not modify ChildActorName during spawn such as removing UAID | Components/ChildActorComponent.h | |
| bNeedsRecreate | uint8 | Flag indicating that when the component is registered that the child actor should be recreated | Components/ChildActorComponent.h | |
| bSetOwner | uint8 | Should the owner of this component be set as the owner of the child actor? | Components/ChildActorComponent.h |
|
| CachedInstanceData | FChildActorComponentInstanceData * | Cached copy of the instance data when the ChildActor is destroyed to be available when needed | Components/ChildActorComponent.h | |
| ChildActor | TObjectPtr< AActor > | The actor that we spawned and own | Components/ChildActorComponent.h |
|
| ChildActorClass | TSubclassOf< AActor > | The class of Actor to spawn | Components/ChildActorComponent.h |
|
| ChildActorName | FName | We try to keep the child actor's name as best we can, so we store it off here when destroying | Components/ChildActorComponent.h | |
| ChildActorTemplate | TObjectPtr< AActor > | Property to point to the template child actor for details panel purposes | Components/ChildActorComponent.h |
|
| EditorTreeViewVisualizationMode | EChildActorComponentTreeViewVisualizationMode | Indicates how this component will be visualized for editing in a tree view. | Components/ChildActorComponent.h | |
| OnChildActorCreatedDelegate | FOnChildActorCreated | Components/ChildActorComponent.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ApplyComponentInstanceData
(
FChildActorComponentInstanceData* ComponentInstanceData, |
Apply the component instance data to the child actor component | Components/ChildActorComponent.h | |
| Create the child actor | Components/ChildActorComponent.h | ||
void DestroyChildActor() |
Kill any currently present child actor | Components/ChildActorComponent.h | |
AActor * GetChildActor() |
Components/ChildActorComponent.h | ||
TSubclassOf< AActor > GetChildActorClass() |
Components/ChildActorComponent.h | ||
FName GetChildActorName() |
Components/ChildActorComponent.h | ||
AActor * GetChildActorTemplate() |
Components/ChildActorComponent.h | ||
EChildActorComponentTreeViewVisualizationMode GetEditorTreeViewVisualizationMode() |
Components/ChildActorComponent.h | ||
AActor * GetSpawnableChildActorTemplate() |
Components/ChildActorComponent.h | ||
FOnChildActorCreated & OnChildActorCreated() |
Components/ChildActorComponent.h | ||
void SetChildActorClass
(
TSubclassOf< AActor > InClass |
Sets the class to use for the child actor. | Components/ChildActorComponent.h |
|
void SetChildActorClass
(
TSubclassOf< AActor > InClass, |
Sets then class to use for the child actor providing an optional Actor to use as the template. | Components/ChildActorComponent.h | |
void SetChildActorName
(
const FName InName |
Components/ChildActorComponent.h | ||
void SetChildActorNameIsExact
(
bool bInExact |
When true, does not modify ChildActorName during spawn such as removing UAID | Components/ChildActorComponent.h | |
void SetEditorTreeViewVisualizationMode
(
EChildActorComponentTreeViewVisualizationMode InMode |
Components/ChildActorComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginPlay () |
Begins Play for the component. | Components/ChildActorComponent.h | |
virtual TStructOnScope< FActorComponentInstanceData > GetComponentInstanceData() |
Called before we throw away components during RerunConstructionScripts, to cache any data we wish to persist across that operation | Components/ChildActorComponent.h | |
virtual TSubclassOf< class UHLODBuilder > GetCustomHLODBuilderClass () |
Return the custom HLODBuilder class that should be used to generate HLODs for components of this type. | Components/ChildActorComponent.h | |
virtual bool IsHLODRelevant() |
Override to specify that a component is relevant to the HLOD generation. | Components/ChildActorComponent.h | |
virtual void OnComponentDestroyed
(
bool bDestroyingHierarchy |
Called when a component is destroyed | Components/ChildActorComponent.h | |
virtual void OnRegister() |
Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called. | Components/ChildActorComponent.h | |
virtual void OnUnregister () |
Called when a component is unregistered. | Components/ChildActorComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
Components/ChildActorComponent.h | ||
virtual void GetLifetimeReplicatedProps
(
TArray< FLifetimeProperty >& OutLifetimeProps |
Components/ChildActorComponent.h | ||
virtual EDataValidationResult IsDataValid
(
FDataValidationContext& Context |
Components/ChildActorComponent.h | ||
virtual void PostEditChangeChainProperty
(
FPropertyChangedChainEvent& PropertyChangedEvent |
Components/ChildActorComponent.h | ||
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Components/ChildActorComponent.h | ||
virtual void PostEditImport() |
Components/ChildActorComponent.h | ||
virtual void PostEditUndo() |
Components/ChildActorComponent.h | ||
virtual void PostLoad() |
Components/ChildActorComponent.h | ||
virtual void PostRepNotifies() |
Components/ChildActorComponent.h | ||
virtual void RegisterReplicationFragments
(
UE::Net::FFragmentRegistrationContext& Context, |
Register all replication fragments | Components/ChildActorComponent.h | |
virtual void Serialize
(
FArchive& Ar |
Components/ChildActorComponent.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddReferencedObjects
(
UObject* InThis, |
Components/ChildActorComponent.h | ||
static bool ExperimentalAllowPerInstanceChildActorProperties() |
Components/ChildActorComponent.h |