Skip to main content

Actor

The Actor class is the base class for all objects that can be placed or spawned in the HELIX world. All lights, pawns, and gameplay entities inherit from this class. It provides functionality for replication, ticking, input handling, transformation, and lifecycle control.


Constructor

Actors are not instantiated directly. You spawn derived classes (e.g., Light, HCharacter, HVehicle, Trigger) which inherit all Actor functionality. Actors can also be spawned via the Unreal HWorld:SpawnActor API.

// Actors are not spawned directly in Blueprint; use derived classes.
// Access an Actor reference from the world or a spawn node.

Networking Functions

MethodParametersReturn TypeDescription
SetReplicatesbInReplicates: booleanvoidSet whether this actor replicates to network clients.
SetReplicateMovementbInReplicateMovement: booleanvoidSet whether this actor's movement replicates to network clients.
HasAuthority--booleanReturns whether this actor has network authority (server-side check).

Ticking Functions

MethodParametersReturn TypeDescription
SetActorTickEnabledbEnabled: booleanvoidEnables or disables the actor's tick function.
IsActorTickEnabled--booleanReturns whether the actor's tick is enabled.
SetActorTickIntervalTickInterval: numbervoidSets the tick interval of this actor's primary tick function. Takes effect on next tick.
GetActorTickInterval--numberReturns the tick interval of this actor's primary tick function.

Transform Functions

MethodParametersReturn TypeDescription
K2_SetActorLocationNewLocation: Vector, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanbooleanMoves the actor to the specified world-space location.
K2_GetActorLocation--VectorReturns the world location of the actor's RootComponent.
K2_SetActorRotationNewRotation: Rotator, bTeleport: booleanbooleanSets the actor's rotation.
K2_GetActorRotation--RotatorReturns the world rotation of the actor's RootComponent.
K2_SetActorLocationAndRotationNewLocation: Vector, NewRotation: Rotator, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanbooleanMoves the actor to the specified location and rotation.
K2_SetActorTransformNewTransform: Transform, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanbooleanSets the actor's full transform.
K2_TeleportToDestLocation: Vector, DestRotation: RotatorbooleanTeleports the actor to a new location, adjusting if it does not fit.
SetActorScale3DNewScale3D: VectorvoidSets the actor's world-space scale.
SetActorRelativeScale3DNewRelativeScale: VectorvoidSets the actor's RootComponent to the specified relative scale.
GetTransform--TransformReturns the full world-space transform (location, rotation, scale).
GetActorScale3D--VectorReturns the actor's current world-space scale.
GetActorRelativeScale3D--VectorReturns the scale of the actor's root component relative to its parent.
K2_GetRootComponent--SceneComponentReturns the root scene component of the actor.
K2_SetActorRelativeLocationNewRelativeLocation: Vector, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanvoidSets the actor's RootComponent to the specified relative location.
K2_SetActorRelativeRotationNewRelativeRotation: Rotator, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanvoidSets the actor's RootComponent to the specified relative rotation.
K2_SetActorRelativeTransformNewRelativeTransform: Transform, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanvoidSets the actor's RootComponent to the specified relative transform.
K2_AddActorWorldOffsetDeltaLocation: Vector, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanvoidAdds a delta to the location of this actor in world space.
K2_AddActorWorldRotationDeltaRotation: Rotator, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanvoidAdds a delta to the rotation of this actor in world space.
K2_AddActorWorldTransformDeltaTransform: Transform, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanvoidApplies a delta transform in world space.
K2_AddActorWorldTransformKeepScaleDeltaTransform: Transform, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanvoidApplies a delta transform in world space while preserving scale.
K2_AddActorLocalOffsetDeltaLocation: Vector, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanvoidAdds a local-space delta location to the actor's root.
K2_AddActorLocalRotationDeltaRotation: Rotator, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanvoidAdds a local-space delta rotation to the actor's root.
K2_AddActorLocalTransformDeltaTransform: Transform, bSweep: boolean, SweepHitResult: HitResult, bTeleport: booleanvoidAdds a delta transform relative to the actor's local frame.
GetActorEyesViewPointOutLocation: Vector, OutRotation: RotatorvoidReturns the viewpoint (location and rotation) of the actor's eyes.

Attachment Functions

MethodParametersReturn TypeDescription
K2_AttachToActorParentActor: Actor, SocketName: string, LocationRule: EAttachmentRule, RotationRule: EAttachmentRule, ScaleRule: EAttachmentRule, bWeldSimulatedBodies: booleanvoidAttaches this actor's RootComponent to another actor.
K2_DetachFromActorLocationRule: EDetachmentRule, RotationRule: EDetachmentRule, ScaleRule: EDetachmentRulevoidDetaches this actor's RootComponent from any parent.
K2_AttachToComponentParent: SceneComponent, SocketName: string, LocationRule: EAttachmentRule, RotationRule: EAttachmentRule, ScaleRule: EAttachmentRule, bWeldSimulatedBodies: booleanvoidAttaches this actor's RootComponent to a scene component.
K2_AttachRootComponentToActorInParentActor: Actor, InSocketName: string, AttachLocationType: EAttachLocation, bWeldSimulatedBodies: booleanvoidSimplified variant for attaching to another actor.
K2_AttachRootComponentToInParent: SceneComponent, InSocketName: string, AttachLocationType: EAttachLocation, bWeldSimulatedBodies: booleanvoidLower-level variant for attaching to a scene component.
DetachRootComponentFromParentbMaintainWorldPosition: booleanvoidDetaches the actor's RootComponent from its parent.
GetAttachedActorsOutActors: table, bResetArray: boolean, bRecursivelyIncludeAttachedActors: booleanvoidFills an array with all actors attached to this actor.

Lifecycle Functions

MethodParametersReturn TypeDescription
SetLifeSpanInLifespan: numbervoidSets the lifespan in seconds. Pass 0 to cancel and prevent auto-destruction.
GetLifeSpan--numberGets the remaining lifespan. Returns 0 if the actor lives forever.
K2_DestroyActor--voidDestroys the actor and removes it from the level.
IsActorBeingDestroyed--booleanReturns true if the actor is currently being destroyed.

Collision Functions

MethodParametersReturn TypeDescription
SetActorEnableCollisionbNewActorEnableCollision: booleanvoidEnables or disables collision for the whole actor.
GetActorEnableCollision--booleanReturns whether collision is currently enabled.
GetActorBoundsbOnlyCollidingComponents: boolean, Origin: Vector, BoxExtent: Vector, bIncludeFromChildActors: booleanvoidReturns the origin and box extent of the actor's combined components.

Component Functions

MethodParametersReturn TypeDescription
GetComponentByClassComponentClass: ClassActorComponentReturns the first component matching the specified class, or nil if none found.
K2_GetComponentsByClassComponentClass: ClasstableReturns all components of the specified class.
AddComponentByClassClass: Class, bManualAttachment: boolean, RelativeTransform: Transform, bDeferredFinish: booleanActorComponentCreates and adds a new component of the given class.
FinishAddComponentComponent: ActorComponent, bManualAttachment: boolean, RelativeTransform: TransformvoidFinalizes the creation of a new actor component.

Input Functions

MethodParametersReturn TypeDescription
EnableInputPlayerController: PlayerControllervoidAdds this actor to the input stack for the specified PlayerController.
DisableInputPlayerController: PlayerControllervoidRemoves this actor from the input stack.

View and Direction Functions

MethodParametersReturn TypeDescription
GetActorForwardVector--VectorReturns the forward (X axis) vector of the actor in world space.
GetActorRightVector--VectorReturns the right (Y axis) vector of the actor in world space.
GetActorUpVector--VectorReturns the up (Z axis) vector of the actor in world space.

Distance Functions

MethodParametersReturn TypeDescription
GetVelocity--VectorReturns the velocity in cm/s.
GetDistanceToOtherActor: ActornumberReturns the full 3D distance to another actor.
GetSquaredDistanceToOtherActor: ActornumberReturns the squared 3D distance (avoids square root).
GetHorizontalDistanceToOtherActor: ActornumberReturns the horizontal (XY) distance to another actor.
GetSquaredHorizontalDistanceToOtherActor: ActornumberReturns the squared horizontal distance.
GetVerticalDistanceToOtherActor: ActornumberReturns the vertical (Z-axis only) distance.

Visibility Functions

MethodParametersReturn TypeDescription
SetActorHiddenInGamebNewHidden: booleanvoidShows or hides the actor in the game world.

Examples

Moving an Actor

// Set actor location via the K2_SetActorLocation node
MyActor->K2_SetActorLocation(FVector(500.f, 0.f, 200.f), true, nullptr, false);

Attaching Actors

ChildActor->K2_AttachToActor(ParentActor, "SocketName",
EAttachmentRule::KeepWorld,
EAttachmentRule::KeepWorld,
EAttachmentRule::KeepWorld, true);

Performance

Disable tick on actors that do not need per-frame updates. Calling SetActorTickEnabled(false) on static props can significantly improve server and client performance.