Skip to main content
Version: latest - a1.3.0 ⚖️

✨ Particle

Particle Entity.

info

🟦🟧 Authority: This class can be spawned on both Client and Server (if you spawn it on client, it won't be synchronized with other players).

⏬ Inheritance: This class inherits from Actor.

tip

Both Cascade and Niagara Particle Systems are supported!

Usage​

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

Constructor Parameters​

TypeNameDefault
VectorlocationVector(0, 0, 0)
RotatorrotationRotator(0, 0, 0)
Particle Assetasset
booleanauto_destroytrue
booleanauto_activatetrue
Note

auto_destroy means the 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.

Functions​

Inherited Actor Functions
Base Actorscripting-reference/classes/base-classes/actor
ReturnsNameDescription
AddImpulseApplies a Force in world space to this Actor
AttachToAttaches this Actor to another Actor
DestroyDestroys this Actor
DetachDetaches this Actor if attached
SetCollisionSets this Actor’s collision type
SetForceAdds a permanent force to this Actor
SetGravityEnabledSets whether gravity is enabled on this Actor
SetVisibilitySets the Actor visibility
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
SetLocationSets this Actor’s location in the game world
SetNetworkAuthoritySets the Player this Actor will have its physics calculated on Network Authority
SetRelativeLocationSets this Actor’s relative location in local space
SetRelativeRotationSets this Actor’s relative rotation in local space
SetRotationSets this Actor’s rotation in the game world
SetScaleSets this Actor’s scale
SetValueSets a value in this Actor, which can be accessed by any package
TranslateToSmoothly moves this Actor to the specified location
RotateToSmoothly rotates this Actor to the specified angle
booleanIsBeingDestroyedGets if this Actor is being destroyed
booleanIsGravityEnabledGets whether gravity is enabled on this Actor
booleanIsInWaterGets if this Actor is in water
booleanIsNetworkDistributedGets if this Actor is Network Distributed
booleanIsValidReturns if this Actor is valid (i.e. not destroyed)
tableGetAttachedEntitiesGets all Actors attached to this Actor
anyGetAttachedToGets the Actor this Actor is attached to
tableGetBoundsGets this Actor's bounds
numberGetCollisionGets this Actor’s collision type
numberGetIDGets the universal network ID of this Actor
VectorGetLocationGets this Actor’s location in the game world
RotatorGetRotationGets this Actor’s angle in the game world
VectorGetScaleGets this Actor’s scale
stringGetTypeGets the type of this Actor
anyGetValueGets a value stored on this Actor at the given key
VectorGetVelocityReturns this Actor's current velocity
functionSubscribeSubscribes to an Event
UnsubscribeUnsubscribes from an Event
ReturnsNameDescription
ResetActivates the Emitter again
SetParameterFloatSets a Float parameter in this Particle System
SetParameterIntSets an Integer parameter in this Particle System
SetParameterBoolSets a Boolean parameter in this Particle System
SetParameterVectorSets a Vector parameter in this Particle System
SetParameterColorSets a Color parameter in this Particle System

Reset​

Activates the Emitter again

my_particle:Reset()

SetParameterFloat​

Sets a float parameter in this Particle System

my_particle:SetParameterFloat(parameter, value)
TypeParameterDescription
stringparameterThe parameter name
numbervalueThe float value

SetParameterInt​

Sets an integer parameter in this Particle System

my_particle:SetParameterInt(parameter, value)
TypeParameterDescription
stringparameterThe parameter name
numbervalueThe int value

SetParameterBool​

Sets a boolean parameter in this Particle System

my_particle:SetParameterBool(parameter, value)
TypeParameterDescription
stringparameterThe parameter name
booleanvalueThe boolean value

SetParameterVector​

Sets a float parameter in this Particle System

my_particle:SetParameterVector(parameter, value)
TypeParameterDescription
stringparameterThe parameter name
VectorvalueThe Vector value

SetParameterColor​

Sets a Color parameter in this Particle System

my_particle:SetParameterColor(parameter, value)
TypeParameterDescription
stringparameterThe parameter name
ColorvalueThe Color value

Events​

Inherited Actor Events
Base Actorscripting-reference/classes/base-classes/actor
NameDescription
DestroyTriggered when an Actor is destroyed
SpawnTriggered when an Actor is spawned/created
ValueChangeTriggered when an Actor has a value changed with :SetValue()