Base Actor
An Actor is an object which can be spawned and destroyed through Lua.
Actors support 3D transformations such as translation (location), rotation, and scale.
An Actor is the base for several entities, and all those entities share the same Methods and Events described in this page.
This is the base class for all Actors we have. You cannot spawn it directly.
๐ฟย Static Functionsโ
This entity doesn't have own static functions.๐ฆ ย Functionsโ
Some of the following methods may not work on certain Actor classes.
Returns | Name | Description | |
---|---|---|---|
![]() | AddImpulse | Applies a force in world world to this Actor | |
AttachTo | Attaches this Actor to any other Actor, optionally at a specific bone | ||
Detach | Detaches this Actor from AttachedTo Actor | ||
SetCollision | Sets this Actor's collision type | ||
SetDimension | Sets this Actor's Dimension | ||
![]() | SetForce | Adds a permanent force to this Actor, set to Vector(0, 0, 0) to cancel | |
SetGravityEnabled | Sets whether gravity is enabled on this Actor | ||
![]() | SetVisibility | Sets whether the actor is visible or not | |
SetHighlightEnabled | Sets whether the highlight is enabled on this Actor, and which highlight index to use | ||
SetOutlineEnabled | Sets whether the outline is enabled on this Actor, and which outline index to use | ||
SetLifeSpan | Sets the time (in seconds) before this Actor is destroyed. After this time has passed, the actor will be automatically destroyed. | ||
SetLocation | Sets this Actor's location in the game world | ||
SetRotation | Sets this Actor's rotation in the game world | ||
SetRelativeLocation | Sets this Actor's relative location in local space (only if this actor is attached) | ||
SetRelativeRotation | Sets this Actor's relative rotation in local space (only if this actor is attached) | ||
SetScale | Sets this Actor's scale | ||
SetNetworkAuthority | Sets the Player to have network authority over this Actor | ||
SetNetworkAuthorityAutoDistributed | Sets if this Actor will auto distribute the network authority betwen players | ||
![]() | TranslateTo | Smoothly moves this actor to a location over a certain time | |
![]() | RotateTo | Smoothly rotates this actor to an angle over a certain time | |
![]() | boolean | IsBeingDestroyed | Returns true if this Actor is being destroyed |
![]() | boolean | IsVisible | Returns true if this Actor is visible |
![]() | boolean | IsGravityEnabled | Returns true if gravity is enabled on this Actor |
![]() | boolean | IsInWater | Returns true if this Actor is in water |
![]() | boolean | IsNetworkDistributed | Returns true if this Actor is currently network distributed |
![]() | table of Base Actor | GetAttachedEntities | Gets all Actors attached to this Actor |
![]() | Base Actor or nil | GetAttachedTo | Gets the Actor this Actor is attached to |
table | GetBounds | Gets this Actor's bounds | |
![]() | CollisionType | GetCollision | Gets this Actor's collision type |
![]() | Vector | GetLocation | Gets this Actor's location in the game world |
![]() | Vector | GetRelativeLocation | Gets this Actor's Relative Location if it's attached |
Player or nil | GetNetworkAuthority | Gets this Actor's Network Authority Player | |
![]() | Rotator | GetRotation | Gets this Actor's angle in the game world |
![]() | Rotator | GetRelativeRotation | Gets this Actor's Relative Rotation if it's attached |
![]() | Vector | GetForce | Gets this Actor's force (set by SetForce() ) |
![]() | integer | GetDimension | Gets this Actor's dimension |
boolean | HasNetworkAuthority | Returns true if the local Player is currently the Network Authority of this Actor | |
boolean | HasAuthority | Gets if this Actor was spawned by the client side | |
![]() | Vector | GetScale | Gets this Actor's scale |
![]() | Vector | GetVelocity | Gets this Actor's current velocity |
AddActorTag | Adds an Unreal Actor Tag to this Actor | ||
RemoveActorTag | Removes an Unreal Actor Tag from this Actor | ||
table of string | GetActorTags | Gets all Unreal Actor Tags on this Actor | |
boolean | WasRecentlyRendered | Gets if this Actor was recently rendered on screen | |
float | GetDistanceFromCamera | Gets the distance of this Actor from the Camera | |
float | GetScreenPercentage | Gets the percentage of this Actor size in the screen |

AddImpulse
โ
Applies a force in world world to this Actor (the force is applied client side, by, in most cases, the player closest to this Actor)
my_actor:AddImpulse(force, velocity_change?)

AttachTo
โ
Attaches this Actor to any other Actor, optionally at a specific bone
AttachmentRule.KeepRelative
will keep the current relative position/rotation if already attached.AttachmentRule.KeepWorld
will calculate the new relative position/rotation so the Actor stays at the same position after being attached.AttachmentRule.SnapToTarget
will set the Actor to the same position/rotation asother_actor
(or at the bone location) and reset its relative position/rotation to zero.Setting
lifespan_when_detached
to0
will automatically destroy this actor when detached, setting it to10
will destroy this after 10 seconds when detached.
my_actor:AttachTo(other, attachment_rule?, bone_name?, lifespan_when_detached?, use_absolute_rotation?)
Type | Parameter | Default | Description |
---|---|---|---|
Base Actor | other | Other actor to attach | |
AttachmentRule | attachment_rule? | SnapToTarget | How to attach |
string | bone_name? |
| Which bone to attach to |
float | lifespan_when_detached? | -1 | Seconds before destroying this Actor when detached |
boolean | use_absolute_rotation? | false | Whether to force attached object to use absolute rotation (will not follow parent) |

Detach
โ
Detaches this Actor from AttachedTo Actor
my_actor:Detach()

SetCollision
โ
Sets this Actor's collision type
my_actor:SetCollision(collision_type)
Type | Parameter | Default | Description |
---|---|---|---|
CollisionType | collision_type |

SetDimension
โ
Sets this Actor's Dimension
my_actor:SetDimension(dimension)
Type | Parameter | Default | Description |
---|---|---|---|
integer | dimension |
See also DimensionChange.

SetForce
โ
Adds a permanent force to this Actor, set to Vector(0, 0, 0) to cancel
my_actor:SetForce(force, is_local?)
Type | Parameter | Default | Description |
---|---|---|---|
Vector | force | ||
boolean | is_local? | true | Whether to apply the force in local space |

SetGravityEnabled
โ
Sets whether gravity is enabled on this Actor
my_actor:SetGravityEnabled(is_enabled)
Type | Parameter | Default | Description |
---|---|---|---|
boolean | is_enabled |

SetVisibility
โ
Sets whether the actor is visible or not
my_actor:SetVisibility(is_visible)
Type | Parameter | Default | Description |
---|---|---|---|
boolean | is_visible |

SetHighlightEnabled
โ
Sets whether the highlight is enabled on this Actor, and which highlight index to use. This will apply the hight on every attached entity too
my_actor:SetHighlightEnabled(is_enabled, index?)
See also Client.SetHighlightColor().

SetOutlineEnabled
โ
Sets whether the outline is enabled on this Actor, and which outline index to use. This will apply the outline on every attached entity too
my_actor:SetOutlineEnabled(is_enabled, index?)
See also Client.SetOutlineColor().

SetLifeSpan
โ
Sets the time (in seconds) before this Actor is destroyed. After this time has passed, the actor will be automatically destroyed.
my_actor:SetLifeSpan(seconds)
Type | Parameter | Default | Description |
---|---|---|---|
float | seconds | Seconds before being destroyed |

SetLocation
โ
Sets this Actor's location in the game world
my_actor:SetLocation(location)
Type | Parameter | Default | Description |
---|---|---|---|
Vector | location |

SetRotation
โ
Sets this Actor's rotation in the game world
my_actor:SetRotation(rotation)
Type | Parameter | Default | Description |
---|---|---|---|
Rotator | rotation |

SetRelativeLocation
โ
Sets this Actor's relative location in local space (only if this actor is attached)
my_actor:SetRelativeLocation(relative_location)
Type | Parameter | Default | Description |
---|---|---|---|
Vector | relative_location |

SetRelativeRotation
โ
Sets this Actor's relative rotation in local space (only if this actor is attached)
my_actor:SetRelativeRotation(relative_rotation)
Type | Parameter | Default | Description |
---|---|---|---|
Rotator | relative_rotation |

SetScale
โ
Sets this Actor's scale
my_actor:SetScale(scale)
Type | Parameter | Default | Description |
---|---|---|---|
Vector | scale |

SetNetworkAuthority
โ
Sets the Player to have network authority over this Actor. This Player will be manually assigned to handle this Actor's physics and share its location with other clients. The authority assignment will still be overridden by the game automatically
Please refer to Network Authority for more information
my_actor:SetNetworkAuthority(player?)
Type | Parameter | Default | Description |
---|---|---|---|
Player | player? | nil | New player which will assume the Network Authority of this Actor |

SetNetworkAuthorityAutoDistributed
โ
Sets if this Actor will auto distribute the network authority betwen players when idle
Please refer to Network Authority for more information
my_actor:SetNetworkAuthorityAutoDistributed(auto_distribute)
Type | Parameter | Default | Description |
---|---|---|---|
boolean | auto_distribute | If this Actor will be auto network distributed |

TranslateTo
โ
Smoothly moves this actor to a location over a certain time
my_actor:TranslateTo(location, time, exp?)
Type | Parameter | Default | Description |
---|---|---|---|
Vector | location | ||
float | time | Time to interpolate from current location to target location | |
float | exp? | 0 | Exponent used to smooth interpolation. Use 0 for linear movement |

RotateTo
โ
Smoothly rotates this actor to an angle over a certain time
my_actor:RotateTo(rotation, time, exp?)
Type | Parameter | Default | Description |
---|---|---|---|
Rotator | rotation | ||
float | time | Time to interpolate from current location to target location | |
float | exp? | 0 | Exponent used to smooth interpolation. Use 0 for linear movement |

IsBeingDestroyed
โ
Returns true if this Actor is being destroyed.
You can check this inside events likeDrop
to see if a Pickable is being dropped because it's going to be destroyed
โ Returns boolean.
local ret = my_actor:IsBeingDestroyed()

IsVisible
โ
Returns true if this Actor is visible
โ Returns boolean.
local ret = my_actor:IsVisible()

IsGravityEnabled
โ
Returns true if gravity is enabled on this Actor
โ Returns boolean.
local ret = my_actor:IsGravityEnabled()

IsInWater
โ
Returns true if this Actor is in water
โ Returns boolean.
local ret = my_actor:IsInWater()

IsNetworkDistributed
โ
Returns true if this Actor is currently network distributed. Only actors being network distributed can have their network authority set
Entities have NetworkDistributed automatically disabled when: Attached, Possessed, Grabbed, Picked Up or Driving
โ Returns boolean.
local ret = my_actor:IsNetworkDistributed()

GetAttachedEntities
โ
Gets all Actors attached to this Actor
โ Returns table of Base Actor.
local ret = my_actor:GetAttachedEntities()

GetAttachedTo
โ
Gets the Actor this Actor is attached to
โ Returns Base Actor or nil.
local ret = my_actor:GetAttachedTo()

GetBounds
โ
Gets this Actor's bounds
โ Returns table (in the format { Origin: Vector, BoxExtent: Vector, SphereRadius: float }
).
local ret = my_actor:GetBounds()

GetCollision
โ
Gets this Actor's collision type
โ Returns CollisionType.
local ret = my_actor:GetCollision()

GetLocation
โ
Gets this Actor's location in the game world
โ Returns Vector.
local ret = my_actor:GetLocation()

GetRelativeLocation
โ
Gets this Actor's Relative Location if it's attached
โ Returns Vector.
local ret = my_actor:GetRelativeLocation()

GetNetworkAuthority
โ
Gets this Actor's Network Authority Player
local ret = my_actor:GetNetworkAuthority()

GetRotation
โ
Gets this Actor's angle in the game world
โ Returns Rotator.
local ret = my_actor:GetRotation()

GetRelativeRotation
โ
Gets this Actor's Relative Rotation if it's attached
โ Returns Rotator.
local ret = my_actor:GetRelativeRotation()

GetForce
โ
Gets this Actor's force (set by SetForce()
)
โ Returns Vector.
local ret = my_actor:GetForce()

GetDimension
โ
Gets this Actor's dimension
โ Returns integer.
local ret = my_actor:GetDimension()
See also DimensionChange.

HasNetworkAuthority
โ
Returns true if the local Player is currently the Network Authority of this Actor
โ Returns boolean.
local ret = my_actor:HasNetworkAuthority()

HasAuthority
โ
Gets if this Actor was spawned by the client side
โ Returns boolean (false if it was spawned by the Server or true if it was spawned by the client).
local ret = my_actor:HasAuthority()

GetScale
โ
Gets this Actor's scale
โ Returns Vector.
local ret = my_actor:GetScale()

GetVelocity
โ
Gets this Actor's current velocity
โ Returns Vector.
local ret = my_actor:GetVelocity()

AddActorTag
โ
Adds an Unreal Actor Tag to this Actor
my_actor:AddActorTag(tag)
Type | Parameter | Default | Description |
---|---|---|---|
string | tag |
See also RemoveActorTag, GetActorTags.

RemoveActorTag
โ
Removes an Unreal Actor Tag from this Actor
my_actor:RemoveActorTag(tag)
Type | Parameter | Default | Description |
---|---|---|---|
string | tag |
See also AddActorTag, GetActorTags.

GetActorTags
โ
Gets all Unreal Actor Tags on this Actor
local ret = my_actor:GetActorTags()
See also AddActorTag, RemoveActorTag.

WasRecentlyRendered
โ
Gets if this Actor was recently rendered on screen
โ Returns boolean.
local ret = my_actor:WasRecentlyRendered()

GetDistanceFromCamera
โ
Gets the distance of this Actor from the Camera
โ Returns float.
local ret = my_actor:GetDistanceFromCamera()

GetScreenPercentage
โ
Gets the percentage of this Actor size in the screen
โ Returns float.
local ret = my_actor:GetScreenPercentage()
๐ย Eventsโ
Name | Description | |
---|---|---|
DimensionChange | Triggered when an Actor changes it's dimension |

DimensionChange
โ
Triggered when an Actor changes it's dimension
Actor.Subscribe("DimensionChange", function(self, old_dimension, new_dimension)
end)
Type | Argument | Description |
---|---|---|
Base Actor | self | |
integer | old_dimension | |
integer | new_dimension |