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

✨ Particle

Particle Entity.

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),    "nanos-world::P_Explosion",    true, -- Auto Destroy?    true -- Auto Activate?)

Constructor Parameters#

TypeNameDefault
VectorlocationVector(0, 0, 0)
RotatorrotationRotator(0, 0, 0)
stringmodel_name``
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 coordinate on this Actor
AttachToAttaches this Actor to any other Actor
DestroyDestroys this Actor
DetachDetaches this Actor if attached
SetCollisionSets the actor’s collision type
SetForceAdds a permanent force to this actor
SetGravityEnabledSets the actor’s gravity enabled
SetHighlightEnabledEnables this Actor Highlighting at a specific Index color
SetLifeSpanSets the actor’s life span to be destroyed
SetLocationSets the actor’s location in the game world
SetNetworkAuthoritySets this actor’s new Player Network Authority
SetRelativeLocationSets the actor’s relative location in local space
SetRelativeRotationSets the actor’s relative rotation in local space
SetRotationSets the actor’s rotation in the game world
SetScaleSets the actor’s scale
SetValueSets a value in this entity, which can be accessed by any package
TranslateToSmoothly moves this actor to a Location
RotateToSmoothly rotates this actor to a Rotation
booleanIsGravityEnabledGets the actor’s gravity enabled
booleanIsInWaterGets if the actor is in Water
booleanIsNetworkDistributedGets if the actor is Network Distributed
booleanIsValidReturns if this entity is valid (i.e. not destroyed)
tableGetAttachedEntitiesGets all actors attached to this entity
anyGetAttachedToGets the actor this actor is attached to
tableGetBoundsGets the actor bounds size
numberGetCollisionGets the current actor’s collision
numberGetIDGets the universal network ID of this entity
VectorGetLocationGet the actor’s position in the game world
VectorGetInitialLocationGets the initial location
RotatorGetRotationGets the actor’s rotation in the game world
VectorGetScaleGets the actor’s scale
stringGetTypeReturns the type of this Actor
anyGetValueGets a value given a key
VectorGetVelocityReturns the current actor Velocity
SubscribeSubscribes for an Event
UnsubscribeUnsubscribes from Events
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)
TypeParameterDescription
numberparameterThe float parameter

SetParameterInt#

Sets an integer parameter in this Particle System

my_particle:SetParameterInt(parameter)
TypeParameterDescription
numberparameterThe int parameter

SetParameterBool#

Sets a boolean parameter in this Particle System

my_particle:SetParameterBool(parameter)
TypeParameterDescription
booleanparameterThe boolean parameter

SetParameterVector#

Sets a float parameter in this Particle System

my_particle:SetParameterVector(parameter)
TypeParameterDescription
VectorparameterThe Vector parameter

SetParameterColor#

Sets a Color parameter in this Particle System

my_particle:SetParameterColor(parameter)
TypeParameterDescription
ColorparameterThe Color parameter

Events#

Inherited Actor Events
Base Actorscripting-reference/classes/base-classes/actor
NameDescription
DestroyTriggered when an Entity is Destroyed
SpawnTriggered when an Entity is Spawned/Created
ValueChangeTriggered when an Entity has it’s value changed