Particle
Warning
This class is deprecated, use Niagara instead!
Constructor#
Example
local fx = Particle(
Vector(0, 0, 100),
Rotator(0, 0, 0),
"/Game/Particles/P_Explosion.P_Explosion",
true,
true
)
| Name | Type | Default | Description |
|---|---|---|---|
Location |
Vector |
(0,0,0) |
World-space spawn position |
Rotation |
Rotator |
(0,0,0) |
Initial rotation of the effect |
AssetPath |
string |
Required | Path to the UParticleSystem asset |
bAutoDestroy |
boolean |
true |
Destroy the component automatically when finished |
bAutoActivate |
boolean |
true |
Play the effect immediately on spawn |
Functions#
SetTemplate#
Changes the particle system to a different UParticleSystem asset at runtime
Example
fx:SetTemplate(UE.UObject.Load("/Game/Particles/P_Smoke.P_Smoke"))
SetMaterialParameter#
Sets a material parameter by name for the emitter
Example
fx:SetMaterialParameter("MyMaterialParam", myMaterial)
CreateNamedDynamicMaterialInstance#
Creates or retrieves a dynamic material instance for the particle system
Example
local dynMat = fx:CreateNamedDynamicMaterialInstance("MyMatSlot")
dynMat:SetScalarParameterValue("Glow", 1.0)
GetNumActiveParticles#
Returns how many particles are currently active (useful for pooling or gameplay checks)
Example
local count = particle:GetNumActiveParticles()