Ir para o conteúdo principal
Version: latest - a1.11.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 Base 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 Referenceasset``
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
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
SetOutlineEnabledSets whether the outline is enabled on this Actor, and which outline 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
booleanHasNetworkAuthorityGets if the LocalPlayer is currently the Network Authority of this Actor
booleanHasAuthorityGets if this Actor was spawned by the client side
booleanIsBeingDestroyedGets if this Actor is being destroyed
booleanIsGravityEnabledGets whether gravity is enabled on this Actor
booleanIsVisibleGets whether this actor is Visible or not
booleanIsInWaterGets if this Actor is in water
booleanIsNetworkDistributedGets if this Actor is currently 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
VectorGetForceGets this Actor's scale
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
stringAddActorTagAdds an Unreal Actor Tag to this Actor
stringRemoveActorTagRemove an Unreal Actor Tag from this Actor
tableGetActorTagsGets all Unreal Actor Tags from this Actor
functionSubscribeSubscribes to an Event
UnsubscribeUnsubscribes from an Event
ReturnsNameDescription
ActivateActivates the Emitter
DeactivateDeactivates the Emitter
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
SetParameterMaterialSets a Material parameter in this Particle System
SetParameterMaterialFromTextureSets a Material parameter from a Texture in this Particle System
SetParameterMaterialFromCanvasSets a Material parameter from a Canvas in this Particle System
SetParameterMaterialFromWebUISets a Material parameter from a WebUI in this Particle System

Activate

Activates the Emitter

my_particle:Activate(should_reset)
TypeParameterDescription
booleanshould_resetIf should reset

Deactivate

Deactivate the Emitter

my_particle:Deactivate()

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

SetParameterMaterial

Sets a Material parameter in this Particle System

my_particle:SetParameterMaterial(parameter, value)
TypeParameterDescription
stringparameterThe parameter name
Material ReferencevalueThe Material value

SetParameterMaterialFromTexture

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)
TypeParameterDescription
stringparameterThe parameter name
Image PathvalueThe Texture value

SetParameterMaterialFromCanvas

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)
TypeParameterDescription
stringparameterThe parameter name
CanvasvalueThe Canvas entity

SetParameterMaterialFromWebUI

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)
TypeParameterDescription
stringparameterThe parameter name
WebUIvalueThe WebUI entity

Events

Inherited Actor Events
NameDescription
DestroyTriggered when an Actor is destroyed
SpawnTriggered when an Actor is spawned/created
ValueChangeTriggered when an Actor has a value changed with :SetValue()