Particle

https://i.imgur.com/DoiElJS.png

Tip

Both Cascade and Niagara Particle Systems are supported!

Tip

You can spawn this entity is both Client or Server (if you spawn it on client, it won’t be synchronized with other players).

Usage

local my_particle = Particle(
    Vector(-200, 100, 100),
    Rotator(0, 0, 0),
    "NanosWorld::P_Explosion",
    true, -- Auto Destroy?
    true -- Auto Activate?
)

Note

AutoDestroy means the Network Entity will be immediately destroyed after spawned, losing references to the Particle System spawned in-game. So if the Particle System itself loops indefinitely, it will keep playing until the Player reconnects.

Constructor Parameters

Type

Name

Default

Vector

location

Vector(0, 0, 0)

Rotator

rotation

Rotator(0, 0, 0)

string

model_name

boolean

auto_destroy

true

boolean

auto_activate

true

Functions

Returns

Name

Description

Reset()

Activates the Emitter again

SetParameterFloat(string parameter, number value)

Sets a parameter in this Particle System

SetParameterInt(string parameter, number value)

Sets a parameter in this Particle System

SetParameterBool(string parameter, boolean value)

Sets a parameter in this Particle System

SetParameterVector(string parameter, Vector value)

Sets a parameter in this Particle System

SetParameterColor(string parameter, Color value)

Sets a parameter in this Particle System

Functions (Inherited from Actor)

Returns

Name

Description

authority-only-label

AddImpulse(
Vector force,
boolean velocity_change = false
)

Applies a Force in world coordinate on this Actor (the force is applied on Client side, by the (in most of cases) the closest player of this object)

authority-only-label

AttachTo(
Actor other,
string bone_name = “”,
Vector relative_location = Vector(),
Rotator relative_rotation = Rotator()
)

Attaches this Actor to any other Actor with a Relative Offset/Rotation

authority-only-label

Destroy()

Destroys this Actor

authority-only-label

Detach()

Detaches this Actor from AttachedTo Actor

authority-only-label

SetCollision(CollisionType)

Sets the actor’s collision Collision Types: Normal, Static Only, NoCollision

authority-only-label

SetGravityEnabled(boolean)

Sets the actor’s gravity enabled

authority-only-label

SetHighlightEnabled(
boolean,
number Index
)

Sets if this Actors is Highlighting at a specific Index color

authority-only-label

SetInitialLocation(Vector)

Sets the initial location

authority-only-label

SetLocation(Vector)

Sets the actor’s location in the game world

server-only-label

SetNetworkAuthority(
Player player = nil,
number time_ms = 0
)

Sets this actor’s new Player network authority. This player will be manually assigned to handle this actor physics and share it’s location with other clients. The authority assignment will still be overriden by the game automatically, to avoid that set a big time value so the player can keep longer with the authority and override the natural authority selection.

authority-only-label

SetRotation(Rotator)

Sets the actor’s rotation in the game world

authority-only-label

SetScale(Vector)

Sets the actor’s scale

SetValue(
string key,
any value,
boolean sync_on_clients
)

Sets a value in this entity, which can be accessed by any package (optionally sync on clients if called from server)

TranslateTo(
Vector location,
number speed
)

Smoothly moves this actor to a Location with a certain Speed

RotateTo(
Rotator rotation,
number speed
)

Smoothly rotates this actor to a Rotation with a certain Speed

boolean

IsGravityEnabled()

Gets the actor’s gravity enabled

boolean

IsInWater()

Gets if the actor is in Water

boolean

IsValid()

Returns if this entity is valid (i.e. wasn’t destroyed and points to a valid entity)

number

GetCollision()

Gets the current actor’s collision

number

GetID()

Gets the network ID of this entity (same in both client and server)

Vector

GetLocation()

Get the actor’s position in the game world

server-only-label

Vector

GetInitialLocation()

Gets the initial location

Rotator

GetRotation()

Gets the actor’s rotation in the game world

Vector

GetScale()

Gets the actor’s scale

string

GetType()

Returns the type of this Actor

any

GetValue(string key)

Gets a value given a key

client-only-label

Vector

GetVelocity()

Returns the current actor Velocity

Events

Events (Inherited from Actor)

Name

Arguments

Description

Destroy

Entity self

Triggered when an Entity is Destroyed

Spawn

Entity self

Triggered when an Entity is Spawned/Created

ValueChange

Entity self,
string key,
any value

Triggered when an Entity has it’s value changed