Language:
Discover
By Skill Level
By Category

UActorComponent

Choose your OS:

Inheritance Hierarchy

Syntax

class UActorComponent :
    public UObject ,
    public IInterface_AssetUserData

Remarks

ActorComponent is the base class for components that define reusable behavior that can be added to different types of Actors. ActorComponents that have a transform are known as SceneComponents and those that can be rendered are PrimitiveComponents.

Variables

Name Description

Protected variable

TArray < UAssetU ...

 

AssetUserData

Array of user data stored with the component

Public variable

uint8 : 1

 

bAllowAnyoneToDestroyMe

Can this component be destroyed (via K2_DestroyComponent) by any parent

Public variable

uint8 : 1

 

bAllowConcurrentTick

Can we tick this concurrently on other threads?

Protected variable

uint8 : 1

 

bAllowReregistration

Public variable

uint8 : 1

 

bAutoActivate

Whether the component is activated at creation or must be explicitly activated.

Public variable

uint8 : 1

 

bAutoRegister

Does this component automatically register with its owner

Protected variable

uint8 : 1

 

bCanEverAffectNavigation

Whether this component can potentially influence navigation

Public variable

uint8 : 1

 

bEditableWhenInherited

Public variable

uint8 : 1

 

bIsActive

Whether the component is currently active.

Public variable

uint8 : 1

 

bIsEditorOnly

If true, the component will be excluded from non-editor builds

Public variable

uint8 : 1

 

bNavigationRelevant

Cached navigation relevancy flag for collision updates

Protected variable

uint8 : 1

 

bNetAddressable

Is this component safe to ID over the network by name?

Public variable

uint8 : 1

 

bNeverNeedsRenderUpdate

If true, this component never needs a render update.

Protected variable

uint8 : 1

 

bPhysicsStateCreated

If the physics state is currently created for this component

Protected variable

uint8 : 1

 

bRegistered

Indicates if this ActorComponent is currently registered with a scene.

Protected variable

uint8 : 1

 

bRenderStateCreated

If the render state is currently created for this component

Protected variable

uint8 : 1

 

bReplicates

Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!

Public variable

uint8 : 1

 

bTickInEditor

Should this component be ticked in the editor

Public variable

uint8 : 1

 

bWantsBeginPlay

If true, we call the virtual BeginPlay

Public variable

uint8 : 1

 

bWantsInitializeComponent

If true, we call the virtual InitializeComponent

Public variable

TArray < FName >

 

ComponentTags

Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.

Public variable

EComponentCreat ...

 

CreationMethod

Public variable

FActorComponent ...

 

OnComponentActivated

Public variable

FActorComponent ...

 

OnComponentDeactivated

Public variable

FActorComponent ...

 

PrimaryComponentTick

Main tick function for the Actor

Constructors

Name Description

Public function

UActorComponent

(
    const FObjectInitializer & ObjectIn...
)

Default UObject constructor that takes an optional ObjectInitializer.

Functions

Name Description

Public function Virtual

void

 

Activate

(
    bool bReset
)

Activates the SceneComponent

Public function Virtual

UObject cons...

 

AdditionalStatObject()

Give a readable name for this component, including asset name if applicable

Public function Virtual

void

 

AddTickPrerequisiteActor

(
    AActor * PrerequisiteActor
)

Make this component tick after PrerequisiteActor

Public function Virtual

void

 

AddTickPrerequisiteComponent

(
    UActorComponent * PrerequisiteC...
)

Make this component tick after PrerequisiteComponent.

Public function

bool

 

AllowReregistration()

Checked whether the component class allows reregistration

Public function Virtual

void

 

ApplyWorldOffset

(
    const FVector & InOffset,
    bool bWorldShift
)

Called by owner actor on position shifting Component should update all relevant data structures to reflect new actor location

Public function Virtual

void

 

BeginPlay()

BeginsPlay for the component.

Public function

bool

 

CanEverAffectNavigation()

UActorComponent inlines.

Public function Virtual

void

 

CheckForErrors()

Function that gets called from within Map_Check to allow this actor component to check itself for any potential errors and register them with map check dialog.

Public function

void

 

ClearNeedEndOfFrameUpdate()

If we belong to a world, clear the request to do a deferred update.

Public function

bool

 

ComponentHasTag

(
    FName Tag
)

See if this component contains the supplied tag

Public function

bool

 

ComponentIsInLevel

(
    const ULevel * TestLevel
)

Returns true if this actor is contained by TestLevel.

Public function

bool

 

ComponentIsInPersistentLevel

(
    bool bIncludeLevelStreamingPersiste...
)

See if this component is in the persistent level

Public function

void

 

CreatePhysicsState()

Create any physics engine information for this component

Protected function Virtual

void

 

CreateRenderState_Concurrent()

Used to create any rendering thread information for this component

Public function Virtual

void

 

Deactivate()

Deactivates the SceneComponent.

Public function Virtual

void

 

DestroyComponent

(
    bool bPromoteChildren
)

Unregister the component, remove it from its outer Actor's Components array and mark for pending kill.

Public function

void

 

DestroyPhysicsState()

Shut down any physics engine structure for this component

Protected function Virtual

void

 

DestroyRenderState_Concurrent()

Used to shut down any rendering thread structure for this component

Public function

void

 

DetermineUCSModifiedProperties()

Public function

void

 

DoDeferredRenderUpdates_Concurrent()

Uses the bRenderStateDirty/bRenderTransformDirty to perform any necessary work on this component.

Public function Virtual

void

 

EndPlay

(
    const EEndPlayReason::Type EndPlayR...
)

Ends gameplay for this component.

Public function Virtual

bool

 

GetComponentClassCanReplicate()

Public function Virtual

FActorCompon ...

 

GetComponentInstanceData()

Called before we throw away components during RerunConstructionScripts, to cache any data we wish to persist across that operation

Public function

ULevel *

 

GetComponentLevel()

Return the ULevel that this Component is part of.

Public function

float

 

GetComponentTickInterval()

Returns whether this component has tick enabled or not

Public function

bool

 

GetIsReplicated()

Returns whether replication is enabled or not.

Public function

uint32

 

GetMarkedForEndOfFrameUpdateState()

Public function

ENetMode

 

GetNetMode()

Get the network mode (dedicated server, client, standalone, etc) for this component.

Public function

AActor *

 

GetOwner()

Follow the Outer chain to get the AActor that 'Owns' this component

Public function

ENetRole

 

GetOwnerRole()

Get the network role of the Owner, or ROLE_None if there is no owner.

Public function Virtual

FString

 

GetReadableName()

Returns a readable name for this component, including the asset name if applicable By default this appends a space plus AdditionalStatObject()

Public function

FSceneInterf ...

 

GetScene()

Public function

void

 

GetUCSModifiedProperties

(
    TSet < const UProperty * >& Mod...
)

Public function Virtual

UWorld *

 

GetWorld()

Protected function

void

 

HandleCanEverAffectNavigationChange

(
    bool bForceUpdate
)

Makes sure navigation system has up to date information regarding component's navigation relevancy and if it can affect navigation at all

Public function

bool

 

HasBeenCreated()

Public function

bool

 

HasBeenInitialized()

Public function

bool

 

HasBegunPlay()

Protected function Virtual

bool

 

HasValidPhysicsState()

Used to check that DestroyPhysicsState() is working correctly

Public function Virtual

void

 

InitializeComponent()

Initializes the component.

Public function

void

 

InvalidateLightingCache()

Invalidate lighting cache with default options.

Public function Virtual

void

 

InvalidateLightingCacheDetailed

(
    bool bInvalidateBuildEnqueuedLighti...,
    bool bTranslationOnly
)

Called when this actor component has moved, allowing it to discard statically cached lighting information.

Public function Virtual

bool

 

IsActive()

Returns whether the component is active or not

  • The active state of the component.

Public function

bool

 

IsBeingDestroyed()

Returns whether the component is in the process of being destroyed.

Public function

bool

 

IsComponentTickEnabled()

Returns whether this component has tick enabled or not

Public function

bool

 

IsCreatedByConstructionScript()

Public function

bool

 

IsEditableWhenInherited()

Public function Virtual

bool

 

IsNavigationRelevant()

Override to supply actual logic

Public function

bool

 

IsNetMode

(
    ENetMode Mode
)

Test whether net mode is the given mode.

Public function

bool

 

IsNetSimulating()

Returns net role of the owning actor Returns true if we are replicating and not authorative

Public function

bool

 

IsNetStartupComponent()

Returns true if this component was owned by a net startup actor during level load.

Public function

bool

 

IsOwnerRunningUserConstructionScript()

See if the owning Actor is currently running the UCS

Public function

bool

 

IsOwnerSelected()

Returns whether the component's owner is selected.

Public function

bool

 

IsPhysicsStateCreated()

True if the physics 'state' (e.g. physx bodies) are created for this component

Public function Virtual

bool

 

IsReadyForOwnerToAutoDestroy()

Overridable check for a component to indicate to its Owner that it should prevent the Actor from auto destroying when finished

Public function

bool

 

IsRegistered()

See if this component is currently registered

Public function

bool

 

IsRenderStateCreated()

True if the render 'state' (e.g. scene proxy) is created for this component

Public function

bool

 

IsRenderStateDirty()

Public function

bool

 

IsRenderTransformDirty()

Public function

void

 

K2_DestroyComponent

(
    UObject * Object
)

Unregister and mark for pending kill a component.

Public function

void

 

MarkForNeededEndOfFrameRecreate()

If we belong to a world, mark this for a deferred update, otherwise do it now.

Public function

void

 

MarkForNeededEndOfFrameUpdate()

If we belong to a world, mark this for a deferred update, otherwise do it now.

Public function

void

 

MarkRenderDynamicDataDirty()

Indicate that dynamic data for this component needs to be sent at the end of the frame.

Public function

void

 

MarkRenderStateDirty()

Mark the render state as dirty - will be sent to the render thread at the end of the frame.

Public function

void

 

MarkRenderTransformDirty()

Marks the transform as dirty - will be sent to the render thread at the end of the frame

Public function Virtual

void

 

OnActorEnableCollisionChanged()

Called on each component when the Actor's bEnableCollisionChanged flag changes

Public function Virtual

void

 

OnComponentCreated()

Called when a component is created (not loaded)

Public function Virtual

void

 

OnComponentDestroyed

(
    bool bDestroyingHierarchy
)

Called when a component is destroyed

Protected function Virtual

void

 

OnCreatePhysicsState()

Used to create any physics engine information for this component

Protected function Virtual

void

 

OnDestroyPhysicsState()

Used to shut down and physics engine structure for this component

Protected function Virtual

void

 

OnRegister()

WITH_EDITOR.

Public function

void

 

OnRep_IsActive()

Protected function Virtual

void

 

OnUnregister()

Called when a component is unregistered.

Public function Virtual

void

 

PreReplication

(
    IRepChangedPropertyTracker & Change...
)

Called on the component right before replication occurs

Public function

void

 

ReceiveBeginPlay()

Blueprint implementable event for when the component is beginning play, called before its Owner's BeginPlay on Actor BeginPlay or when the component is dynamically created if the Actor has already BegunPlay.

Public function

void

 

ReceiveEndPlay

(
    EEndPlayReason::Type EndPlayReason
)

Blueprint implementable event for when the component ends play, generally via destruction or its Actor's EndPlay.

Public function

void

 

ReceiveTick

(
    float DeltaSeconds
)

Event called every frame

Public function

void

 

RecreatePhysicsState()

Recreate the physics state right way.

Public function

void

 

RecreateRenderState_Concurrent()

Recreate the render state right away.

Public function

void

 

RegisterAllComponentTickFunctions

(
    bool bRegister
)

When called, will call the virtual call chain to register all of the tick functions Do not override this function or make it virtual

Public function

void

 

RegisterComponent()

Register this component, creating any rendering/physics state.

Protected function Virtual

void

 

RegisterComponentTickFunctions

(
    bool bRegister
)

Virtual call chain to register all tick functions

Public function

void

 

RegisterComponentWithWorld

(
    UWorld * InWorld
)

Public function Virtual

void

 

RemoveTickPrerequisiteActor

(
    AActor * PrerequisiteActor
)

Remove tick dependency on PrerequisiteActor.

Public function Virtual

void

 

RemoveTickPrerequisiteComponent

(
    UActorComponent * PrerequisiteC...
)

Remove tick dependency on PrerequisiteComponent.

Public function

void

 

RemoveUCSModifiedProperties

(
    const TArray < UProperty * >& P...
)

Public function Virtual

bool

 

ReplicateSubobjects

(
    UActorChannel * Channel,
    FOutBunch * Bunch,
    FReplicationFlags * RepFlags
)

Allows a component to replicate other subobject on the actor

Public function Virtual

bool

 

RequiresGameThreadEndOfFrameRecreate()

Return true if this component requires end of frame recreates to happen from the game thread.

Public function Virtual

bool

 

RequiresGameThreadEndOfFrameUpdates()

Return true if this component requires end of frame updates to happen from the game thread.

Public function

void

 

ReregisterComponent()

Unregisters and immediately re-registers component. Handles bWillReregister properly.

Protected function Virtual

void

 

SendRenderDynamicData_Concurrent()

Called to send dynamic data for this component to the rendering thread

Protected function Virtual

void

 

SendRenderTransform_Concurrent()

Called to send a transform update for this component to the rendering thread

Public function Virtual

void

 

SetActive

(
    bool bNewActive,
    bool bReset
)

Sets whether the component is active or not

Public function Virtual

void

 

SetAutoActivate

(
    bool bNewAutoActivate
)

Sets whether the component should be auto activate or not. Only safe during construction scripts.

Public function

void

 

SetCanEverAffectNavigation

(
    bool bRelevant
)

Set value of bCanEverAffectNavigation flag and update navigation octree if needed

Public function Virtual

void

 

SetComponentTickEnabled

(
    bool bEnabled
)

Set this component's tick functions to be enabled or disabled.

Public function Virtual

void

 

SetComponentTickEnabledAsync

(
    bool bEnabled
)

Spawns a task on GameThread that will call SetComponentTickEnabled

Public function

void

 

SetComponentTickInterval

(
    float TickInterval
)

Sets the tick interval for this component's primary tick function.

Public function

void

 

SetIsNetStartupComponent

(
    const bool bInIsNetStartupComponent
)

This should only be called by the engine in ULevel::InitializeNetworkActors to initialize bIsNetStartupComponent.

Public function

void

 

SetIsReplicated

(
    bool ShouldReplicate
)

Enable or disable replication.

Public function

void

 

SetNetAddressable()

Networking.

Public function

void

 

SetTickableWhenPaused

(
    bool bTickableWhenPaused
)

Sets whether this component can tick when paused.

Public function

void

 

SetTickGroup

(
    ETickingGroup NewTickGroup
)

Changes the ticking group for this component

Public function

bool

 

SetupActorComponentTickFunction

(
    FTickFunction * TickFunction
)

Set up a tick function for a component in the standard way.

Protected function Virtual

bool

 

ShouldActivate()

"Trigger" related function. Return true if it should activate

Protected function Virtual

bool

 

ShouldCreatePhysicsState()

Return true if CreatePhysicsState() should be called.

Protected function Virtual

bool

 

ShouldCreateRenderState()

Return true if CreateRenderState() should be called

Public function Virtual

void

 

TickComponent

(
    float DeltaTime,
    enum ELevelTick TickType,
    FActorComponentTickFunction * T...
)

Function called every frame on this ActorComponent.

Public function Virtual

void

 

ToggleActive()

Toggles the active state of the component

Public function Virtual

void

 

UninitializeComponent()

Handle this component being Uninitialized.

Public function

void

 

UnregisterComponent()

Unregister this component, destroying any rendering/physics state.

Public function Virtual

void

 

UpdateComponentToWorld

(
    EUpdateTransformFlags UpdateTransfo...,
    ETeleportType Teleport
)

Recalculate the value of our component to world transform

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

bool

 

CallRemoteFunction

(
    UFunction * Function,
    void* Parms,
    FOutParmRec * OutParms,
    FFrame * Stack
)

Call the actor's function remotely

Public function Virtual

int32

 

GetFunctionCallspace

(
    UFunction * Function,
    void* Parameters,
    FFrame * Stack
)

Return the space this function should be called.

Public function Virtual

void

 

GetLifetimeReplicatedProps

(
    TArray < FLifetimeProperty >& OutLi...
)

Returns properties that are replicated for the lifetime of the actor channel

Public function Virtual

bool

 

IsEditorOnly()

Returns whether this component is an editor-only object or not

Public function Virtual

bool

 

IsNameStableForNetworking()

IsNameStableForNetworking means an object can be referred to its path name (relative to outer) over the network

Public function Virtual

bool

 

IsSelectedInEditor()

Test the selection state of a UObject

Public function Virtual

bool

 

IsSupportedForNetworking()

IsSupportedForNetworking means an object can be referenced over the network

Public function Virtual

void

 

MarkAsEditorOnlySubobject()

Public function Virtual

bool

 

Modify

(
    bool bAlwaysMarkDirty
)

Note that the object will be modified.

Public function Virtual

bool

 

NeedsLoadForClient()

Called during saving to determine the load flags to save with the object.

Public function Virtual

bool

 

NeedsLoadForEditorGame()

Called during saving to determine the load flags to save with the object.

Public function Virtual

bool

 

NeedsLoadForServer()

Called during saving to determine the load flags to save with the object.

Public function Virtual

void

 

PostEditChangeChainProperty

(
    FPropertyChangedChainEvent & Proper...
)

This alternate version of PostEditChange is called when properties inside structs are modified.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object, and immediately after any undo/redo.

Public function Virtual

void

 

PostNetReceive()

Always called immediately after properties are received from the remote.

Public function Virtual

void

 

PostRename

(
    UObject * OldOuter,
    const FName OldName
)

WITH_EDITOR.

Public function Virtual

void

 

PreEditChange

(
    UProperty * PropertyAboutToChan...
)

This is called when property is about to be modified by InterpPropertyTracks

Public function Virtual

void

 

PreEditUndo()

Called before applying a transaction to the object.

Public function Virtual

void

 

PreNetReceive()

Always called immediately before properties are received from the remote.

Public function Virtual

bool

 

Rename

(
    const TCHAR * NewName,
    UObject * NewOuter,
    ERenameFlags Flags
)

Rename this object to a unique name.

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

UObject serializer.

Overridden from IInterface_AssetUserData

Name Description

Public function Virtual

void

 

AddAssetUserData

(
    UAssetUserData * InUserData
)

WITH_EDITOR.

Public function Virtual

UAssetUserDa ...

 

GetAssetUserDataOfClass

(
    TSubclassOf < UAssetUserData > InUse...
)

Public function Virtual

void

 

RemoveUserDataOfClass

(
    TSubclassOf < UAssetUserData > InUse...
)

Constants

Name

Description

ComponentTemplateNameSuffix

Prefix used to identify template component instances

GlobalCreatePhysicsDelegate

Create Physics global delegate.

GlobalDestroyPhysicsDelegate

Destroy Physics global delegate.

See Also

References

Module

Engine

Header

Runtime/Engine/Classes/Components/ActorComponent.h