Skip to main content

Particle

Particle allows you to spawn and control legacy visual effects created using Unreal Engineโ€™s deprecated Cascade particle system. Cascade was the original VFX solution used for simulating explosions, fire, smoke, and other environmental effects before Niagara was introduced. While still supported, it is no longer maintained and should only be used for older assets that haven't been converted to Niagara

///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
)
NameTypeDefaultDescription
LocationVector(0,0,0)World-space spawn position
RotationRotator(0,0,0)Initial rotation of the effect
AssetPathstringRequiredPath to the UParticleSystem asset
bAutoDestroybooleantrueDestroy the component automatically when finished
bAutoActivatebooleantruePlay 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()
โœจ