✨ Particle
Class to spawn Particle Systems used to create effects in the world

Both Cascade and Niagara Particle Systems are supported!
🎒 Examples
local my_particle = Particle(
Vector(-200, 100, 100),
Rotator(0, 0, 0),
"nanos-world::P_Explosion",
true, -- Auto Destroy?
true -- Auto Activate?
)
🛠 Constructors
Default Constructor
No description provided
local my_particle = Particle(location, rotation, asset, auto_destroy?, auto_activate?, spawn_mode?)
Parameters
| Name | Type | Description |
|---|---|---|
location | Vector | World location to spawn at |
rotation | Rotator | World rotation to spawn with |
asset | Particle Reference | The asset to use |
auto_destroy? | boolean | Whether to destroy it after it finishes playing Default true |
auto_activate? | boolean | Whether to start playing immediately Default true |
spawn_mode? | SpawnMode | Pass SpawnMode.AfterConstructor or SpawnMode.Manual to avoid immediately sending the entity to clients and improve performance when you want to configure it by setting several configs. Must call FinishSpawn() after all Default SpawnMode.Immediate |
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.
🗿 Static Functions
This class doesn't have own static functions.
Inherited static functions
Subscribe, UnsubscribeSubscribeRemoteGetAll, GetByIndex, GetCount, GetPairs🦠 Functions
Activate | Activates the Emitter | |
Deactivate | Deactivate the Emitter | |
IsActive: boolean | Returns if this Particle is active | |
SetParameterBool | Sets a boolean parameter in this Particle System | |
SetParameterColor | Sets a Color parameter in this Particle System | |
SetParameterFloat | Sets a float parameter in this Particle System | |
SetParameterInt | Sets an integer parameter in this Particle System | |
SetParameterMaterial | Sets a Material parameter in this Particle System | |
SetParameterMaterialFromCanvas | Sets a Material from a Canvas parameter in this Particle System | |
SetParameterMaterialFromTexture | Sets a Material from a Texture parameter in this Particle System | |
SetParameterMaterialFromWebUI | Sets a Material from a Canvas parameter in this Particle System | |
SetParameterVector | Sets a Vector parameter in this Particle System |
Inherited functions
GetDistanceFromCamera, GetScreenPercentage, IsVisible, SetCastShadow, SetHighlightEnabled, SetOutlineEnabled, SetRenderCullDistance, SetVisibility, WasRecentlyRenderedAttachTo, Detach, GetAttachedEntities, GetAttachedTo, GetAttachedToSocket, GetSocketTransformGetLifeSpan, SetLifeSpanGetDimension, GetNetworkAuthority, HasNetworkAuthority, IsNetworkDistributed, SetDimension, SetDistanceOptimizationMultiplier, SetNetworkAuthority, SetNetworkAuthorityAutoDistributedGetAllValuesKeys, GetValue, SetValueSubscribe, UnsubscribeDestroy, FinishSpawn, IsBeingDestroyed, IsSpawned, IsValid, SetSpawnModeBroadcastRemoteEvent, BroadcastRemoteInRadiusEvent, CallRemoteEvent, CallRemoteEvent, CallRemotePlayersEvent, HasAuthority, SubscribeRemoteGetID
ActivateOptimal
Activates the Emitter
my_particle:Activate(should_reset?)
Parameters
| Name | Type | Description |
|---|---|---|
should_reset? | boolean | If should reset Default false |
See also Deactivate, IsActive.

IsActiveOptimal
Returns if this Particle is active
local is_active = my_particle:IsActive()
Returns
| Type | Description |
|---|---|
| boolean | Whether this Particle is active |
See also Activate, Deactivate.

SetParameterBoolOptimal
Sets a boolean parameter in this Particle System
my_particle:SetParameterBool(parameter, value)

SetParameterColorOptimal
Sets a Color parameter in this Particle System
my_particle:SetParameterColor(parameter, value)

SetParameterFloatOptimal
Sets a float parameter in this Particle System
my_particle:SetParameterFloat(parameter, value)

SetParameterIntOptimal
Sets an integer parameter in this Particle System
my_particle:SetParameterInt(parameter, value)

SetParameterMaterialSlow
Sets a Material parameter in this Particle System
my_particle:SetParameterMaterial(parameter, value)
Parameters
| Name | Type | Description |
|---|---|---|
parameter | string | The parameter name |
value | Material Reference | The Material to apply. Note: the material needs to be configured to be "Used with Niagara" or "Used with Particles" in the material asset settings, otherwise it may not be applied correctly |

SetParameterMaterialFromCanvasModerate
Sets a Material from a Canvas parameter in this Particle System
This will create a Material and set this Canvas as it's parameter internally, then set the Material into the Particle parameter
my_particle:SetParameterMaterialFromCanvas(parameter, value)

SetParameterMaterialFromTextureSlow
Sets a Material from a Texture parameter in this Particle System
This will create a Material and set this Texture as it's parameter internally, then set the Material into the Particle parameter
my_particle:SetParameterMaterialFromTexture(parameter, value)
Parameters
| Name | Type | Description |
|---|---|---|
parameter | string | The parameter name |
value | Image Path | The Texture value |

SetParameterMaterialFromWebUIModerate
Sets a Material from a Canvas parameter in this Particle System
This will create a Material and set this WebUI as it's parameter internally, then set the Material into the Particle parameter
my_particle:SetParameterMaterialFromWebUI(parameter, value)

SetParameterVectorOptimal
Sets a Vector parameter in this Particle System
my_particle:SetParameterVector(parameter, value)
🚀 Events
This class doesn't have own events.
Inherited events
ClassRegister, Destroy, Spawn, ValueChange

