Ir para o conteúdo principal
Version: latest - a1.142.x ⚖️

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.

👪Base Class
This is a Base Class. Base Classes are abstract definitions used to share common methods and events between related child classes, thus you cannot spawn it directly.

Classes that share methods and events from this Base Class: Billboard, Blueprint, Cable, Character, CharacterSimple, Decal, Gizmo, Grenade, InstancedStaticMesh, Light, Melee, Particle, Prop, SceneCapture, StaticMesh, Sound, TextRender, Text3D, Trigger, VehicleWheeled, VehicleWater, Weapon, Widget3D.
🧑‍💻API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!

🗿 Static Functions

This class doesn't have own static functions.

🦠 Functions

caution

Some of the following methods may not work on certain Actor classes.

ReturnsNameDescription
AddActorTagAdiciona uma Unreal Actor Tag neste Ator
AddAngularImpulseRealiza um impulso angular neste Actor. Bom por um impulso instantâneo
AddImpulseAdd an impulse to this Actor. Good for one time instant burst
booleanAttachToAttaches this Actor to any other Actor, optionally at a specific bone
DetachDetaches this Actor from AttachedTo Actor
table of stringGetActorTagsGets all Unreal Actor Tags on this Actor
VectorGetAngularForceGets this Actor's angular force (set by SetAngularForce())
table of Base ActorGetAttachedEntitiesGets all Actors attached to this Actor
Base Actor or nilGetAttachedToGets the Actor this Actor is attached to
tableGetBoundsGets this Actor's bounds
CollisionTypeGetCollisionObtém o tipo de colisão deste ator
integerGetDimensionObtém a dimensão deste ator
floatGetDistanceFromCameraObtém a distância deste Ator da Câmera
VectorGetForceGets this Actor's force (set by SetForce())
VectorGetLocationGets this Actor's location in the game world
Player or nilGetNetworkAuthorityGets this Actor's Network Authority Player
VectorGetRelativeLocationGets this Actor's Relative Location if it's attached
RotatorGetRelativeRotationGets this Actor's Relative Rotation if it's attached
RotatorGetRotationGets this Actor's angle in the game world
VectorGetScaleGets this Actor's scale
floatGetScreenPercentageGets the percentage of this Actor size in the screen
tableGetSocketTransformGets a Socket Transform in world space given a bone or socket name
VectorGetVelocityGets this Actor's current velocity
booleanHasNetworkAuthorityReturns true if the local Player is currently the Network Authority of this Actor
booleanIsGravityEnabledReturns true if gravity is enabled on this Actor
booleanIsInWaterReturns true if this Actor is in water
booleanIsNetworkDistributedReturns true if this Actor is currently network distributed
booleanIsVisibleReturns true if this Actor is visible
RemoveActorTagRemoves an Unreal Actor Tag from this Actor
RotateToSmoothly rotates this actor to an angle over a certain time
SetAngularForceAdds a permanent angular force to this Actor, set to Vector(0, 0, 0) to cancel
SetCastShadowSets this Actor's to cast shadows or not
SetCollisionSets this Actor's collision type
SetDimensionSets this Actor's Dimension
SetForceAdds a permanent force to this Actor, set to Vector(0, 0, 0) to cancel
SetGravityEnabledSets whether gravity is enabled on this Actor
SetHighlightEnabledSets whether the highlight is enabled on this Actor, and which highlight index to use
SetLifeSpanSets the time (in seconds) before this Actor is destroyed. After this time has passed, the actor will be automatically destroyed.
SetLocationSets this Actor's location in the game world
SetNetworkAuthoritySets the Player to have network authority over this Actor
SetNetworkAuthorityAutoDistributedSets if this Actor will auto distribute the network authority between players
SetOutlineEnabledSets whether the outline is enabled on this Actor, and which outline index to use
SetRelativeLocationSets this Actor's relative location in local space (only if this actor is attached)
SetRelativeRotationSets this Actor's relative rotation in local space (only if this actor is attached)
SetRenderCullDistanceSets this Actor's render cull distance
SetRotationSets this Actor's rotation in the game world
SetScaleSets this Actor's scale
SetVisibilitySets whether the actor is visible or not
TranslateToSmoothly moves this actor to a location over a certain time
booleanWasRecentlyRenderedGets if this Actor was recently rendered on screen

AddActorTag

Adiciona uma Unreal Actor Tag neste Ator
my_actor:AddActorTag(tag)

Parameters

TypeParameterDefaultDescription
stringtag Required parameter No description provided

See also RemoveActorTag, GetActorTags.


AddAngularImpulse

Realiza um impulso angular neste Actor. Bom por um impulso instantâneo
my_actor:AddAngularImpulse(angular_impulse, velocity_change?)

Parameters

TypeParameterDefaultDescription
Vectorangular_impulse Required parameter Magnitude and direction of impulse to apply. Direction is axis of rotation. In Radians
booleanvelocity_change?falseWhether to ignore mass

AddImpulse

Add an impulse to this Actor. Good for one time instant burst
my_actor:AddImpulse(impulse, velocity_change?)

Parameters

TypeParameterDefaultDescription
Vectorimpulse Required parameter Magnitude and direction of impulse to apply
booleanvelocity_change?falseWhether to ignore mass

AttachTo

Attaches this Actor to any other Actor, optionally at a specific bone
local attached_successfully = my_actor:AttachTo(other, attachment_rule?, bone_name?, lifespan_when_detached?, use_absolute_rotation?)

Parameters

TypeParameterDefaultDescription
Base Actorother Required parameter Other actor to attach
AttachmentRuleattachment_rule?SnapToTargetHow to attach
stringbone_name?Which bone to attach to. If empty it will be attached to the Actor, otherwise to the Mesh at the bone/socket
floatlifespan_when_detached?-1Seconds before destroying this Actor when detached, setting it to 0 will automatically destroy this actor when detached, setting it to 10 will destroy this after 10 seconds when detached
booleanuse_absolute_rotation?falseWhether to force attached object to use absolute rotation (will not follow parent)

Returns

TypeDescription
booleanse foi attachado com sucesso

Detach

Detaches this Actor from AttachedTo Actor
my_actor:Detach()

GetActorTags

Gets all Unreal Actor Tags on this Actor
local ret = my_actor:GetActorTags()

Returns

TypeDescription
table of stringNo description provided

See also AddActorTag, RemoveActorTag.


GetAngularForce

Gets this Actor's angular force (set by SetAngularForce())
local angular_force = my_actor:GetAngularForce()

Returns

TypeDescription
Vectorangular_force

See also SetAngularForce.


GetAttachedEntities

Gets all Actors attached to this Actor
local ret = my_actor:GetAttachedEntities()

Returns

TypeDescription
table of Base ActorNo description provided

GetAttachedTo

Gets the Actor this Actor is attached to
local ret = my_actor:GetAttachedTo()

Returns

TypeDescription
Base Actor or nilNo description provided

GetBounds

Gets this Actor's bounds
local ret = my_actor:GetBounds()

Returns

TypeDescription
tablewith this format

GetCollision

Obtém o tipo de colisão deste ator
local collision_type = my_actor:GetCollision()

Returns

TypeDescription
CollisionTypecollision_type

See also SetCollision.


GetDimension

Obtém a dimensão deste ator
local dimension = my_actor:GetDimension()

Returns

TypeDescription
integerdimension

See also SetDimension, DimensionChange.


GetDistanceFromCamera

Obtém a distância deste Ator da Câmera
local ret = my_actor:GetDistanceFromCamera()

Returns

TypeDescription
floatNo description provided

GetForce

Gets this Actor's force (set by SetForce())
local force = my_actor:GetForce()

Returns

TypeDescription
Vectorforce

See also SetForce.


GetLocation

Gets this Actor's location in the game world
local location = my_actor:GetLocation()

Returns

TypeDescription
Vectorlocation

See also SetLocation.


GetNetworkAuthority

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

Returns

TypeDescription
Player or nilNo description provided

See also SetNetworkAuthority.


GetRelativeLocation

Gets this Actor's Relative Location if it's attached
local relative_location = my_actor:GetRelativeLocation()

Returns

TypeDescription
Vectorrelative_location

See also SetRelativeLocation.


GetRelativeRotation

Gets this Actor's Relative Rotation if it's attached
local relative_rotation = my_actor:GetRelativeRotation()

Returns

TypeDescription
Rotatorrelative_rotation

See also SetRelativeRotation.


GetRotation

Gets this Actor's angle in the game world
local rotation = my_actor:GetRotation()

Returns

TypeDescription
Rotatorrotation

See also SetRotation.


GetScale

Gets this Actor's scale
local scale = my_actor:GetScale()

Returns

TypeDescription
Vectorscale

See also SetScale.


GetScreenPercentage

Gets the percentage of this Actor size in the screen
local ret = my_actor:GetScreenPercentage()

Returns

TypeDescription
floatNo description provided

GetSocketTransform

Gets a Socket Transform in world space given a bone or socket name
local ret = my_actor:GetSocketTransform(socket_name)

Parameters

TypeParameterDefaultDescription
stringsocket_name Required parameter No description provided

Returns

TypeDescription
tablewith this format

GetVelocity

Gets this Actor's current velocity
local velocity = my_actor:GetVelocity()

Returns

TypeDescription
Vectorvelocity

HasNetworkAuthority

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

Returns

TypeDescription
booleanNo description provided

IsGravityEnabled

Returns true if gravity is enabled on this Actor
local gravity_enabled = my_actor:IsGravityEnabled()

Returns

TypeDescription
booleangravity_enabled

See also SetGravityEnabled.


IsInWater

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

Returns

TypeDescription
booleanNo description provided

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
local ret = my_actor:IsNetworkDistributed()

Returns

TypeDescription
booleanNo description provided

See also SetNetworkAuthorityAutoDistributed, SetNetworkAuthority.


IsVisible

Returns true if this Actor is visible
local is_visible = my_actor:IsVisible()

Returns

TypeDescription
booleanis_visible

RemoveActorTag

Removes an Unreal Actor Tag from this Actor
my_actor:RemoveActorTag(tag)

Parameters

TypeParameterDefaultDescription
stringtag Required parameter No description provided

See also AddActorTag, GetActorTags.


RotateTo

Smoothly rotates this actor to an angle over a certain time
my_actor:RotateTo(rotation, time, exp?)

Parameters

TypeParameterDefaultDescription
Rotatorrotation Required parameter No description provided
floattime Required parameter Time to interpolate from current location to target location
floatexp?0Exponent used to smooth interpolation. Use 0 for linear movement

SetAngularForce

Adds a permanent angular force to this Actor, set to Vector(0, 0, 0) to cancel
my_actor:SetAngularForce(angular_force)

Parameters

TypeParameterDefaultDescription
Vectorangular_force Required parameter No description provided

See also GetAngularForce.


SetCastShadow

Sets this Actor's to cast shadows or not
my_actor:SetCastShadow(cast_shadow)

Parameters

TypeParameterDefaultDescription
booleancast_shadow Required parameter No description provided

SetCollision

Sets this Actor's collision type
my_actor:SetCollision(collision_type)

Parameters

TypeParameterDefaultDescription
CollisionTypecollision_type Required parameter No description provided

See also GetCollision.


SetDimension

Sets this Actor's Dimension
my_actor:SetDimension(dimension)

Parameters

TypeParameterDefaultDescription
integerdimension Required parameter No description provided

See also GetDimension, DimensionChange.


SetForce

Adds a permanent force to this Actor, set to Vector(0, 0, 0) to cancel
my_actor:SetForce(force, is_local?)

Parameters

TypeParameterDefaultDescription
Vectorforce Required parameter No description provided
booleanis_local?trueWhether to apply the force in local space

See also GetForce.


SetGravityEnabled

Sets whether gravity is enabled on this Actor
my_actor:SetGravityEnabled(gravity_enabled)

Parameters

TypeParameterDefaultDescription
booleangravity_enabled Required parameter No description provided

See also IsGravityEnabled.


SetHighlightEnabled

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

Parameters

TypeParameterDefaultDescription
booleanis_enabled Required parameter No description provided
integerindex?0Index to use (should be 0, 1 or 2)

See also Client.SetHighlightColor().


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)

Parameters

TypeParameterDefaultDescription
floatseconds Required parameter Seconds before being destroyed

SetLocation

Sets this Actor's location in the game world
my_actor:SetLocation(location)

Parameters

TypeParameterDefaultDescription
Vectorlocation Required parameter No description provided

See also GetLocation.


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?)

Parameters

TypeParameterDefaultDescription
Playerplayer?nilNew player which will assume the Network Authority of this Actor

See also SetNetworkAuthorityAutoDistributed, IsNetworkDistributed, GetNetworkAuthority.


SetNetworkAuthorityAutoDistributed

Sets if this Actor will auto distribute the network authority between players when idle

Please refer to Network Authority for more information
my_actor:SetNetworkAuthorityAutoDistributed(auto_distribute)

Parameters

TypeParameterDefaultDescription
booleanauto_distribute Required parameter If this Actor will be auto network distributed

See also SetNetworkAuthority, IsNetworkDistributed.


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?)

Parameters

TypeParameterDefaultDescription
booleanis_enabled Required parameter No description provided
integerindex?0Index to use (should be 0, 1 or 2)

See also Client.SetOutlineColor().


SetRelativeLocation

Sets this Actor's relative location in local space (only if this actor is attached)
my_actor:SetRelativeLocation(relative_location)

Parameters

TypeParameterDefaultDescription
Vectorrelative_location Required parameter No description provided

See also GetRelativeLocation.


SetRelativeRotation

Sets this Actor's relative rotation in local space (only if this actor is attached)
my_actor:SetRelativeRotation(relative_rotation)

Parameters

TypeParameterDefaultDescription
Rotatorrelative_rotation Required parameter No description provided

See also GetRelativeRotation.


SetRenderCullDistance

Sets this Actor's render cull distance. Note: this will only affect the rendering distance, the entity will still be spawned and synced normally regardless of this distance
my_actor:SetRenderCullDistance(max_distance)

Parameters

TypeParameterDefaultDescription
integermax_distance Required parameter No description provided

SetRotation

Sets this Actor's rotation in the game world
my_actor:SetRotation(rotation)

Parameters

TypeParameterDefaultDescription
Rotatorrotation Required parameter No description provided

See also GetRotation.


SetScale

Sets this Actor's scale
my_actor:SetScale(scale)

Parameters

TypeParameterDefaultDescription
Vectorscale Required parameter No description provided

See also GetScale.


SetVisibility

Sets whether the actor is visible or not
my_actor:SetVisibility(is_visible)

Parameters

TypeParameterDefaultDescription
booleanis_visible Required parameter No description provided

TranslateTo

Smoothly moves this actor to a location over a certain time
my_actor:TranslateTo(location, time, exp?)

Parameters

TypeParameterDefaultDescription
Vectorlocation Required parameter No description provided
floattime Required parameter Time to interpolate from current location to target location
floatexp?0Exponent used to smooth interpolation. Use 0 for linear movement

WasRecentlyRendered

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

Returns

TypeDescription
booleanNo description provided

🚀 Events

NameDescription
DimensionChangeTriggered 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)
-- DimensionChange was called
end)

Arguments

TypeArgumentDescription
Base ActorselfNo description provided
integerold_dimensionNo description provided
integernew_dimensionNo description provided

See also SetDimension, GetDimension.