ParticleSystem (SDK7)
Emit particles from an entity. One
component per entity, attached alongside a
. No mesh required — particles render from the component itself.
RULE: Transform.scale does NOT scale particles
Particle size is controlled exclusively by
and
(FloatRange). The
also sets emitter shape's spatial dimensions when the shape has size fields (Sphere radius, Box size, Cone radius). These are not affected by the entity's
. Setting
larger does not produce bigger particles.
RULE: Particles only render to players inside scene parcels
Players viewing the scene from outside its parcels see nothing. Particles are not part of the scene LOD silhouette. Position emitters within parcel bounds.
RULE: Particles only work in the Unity explorer
The mobile Godot explorer and the Bevy explorer don't have this feature implemented. The renderer ignores the component.
RULE: Engine caps total particles at ~1000
The engine enforces a per-scene particle budget and will scale down emission rates across all active particle systems if total live particles would exceed the limit. Cap each system with
and prefer fewer impactful systems over many small ones.
RULE: prewarm requires loop = true
only takes effect when
. On a one-shot system (
) prewarm is silently ignored.
RULE: faceTravelDirection overrides billboard
When
faceTravelDirection: true
, particles orient along their velocity vector and
is ignored. Use this for trails/streaks (asteroids, bullets, sparks). Set
explicitly to avoid confusion.
Import
typescript
import { engine, Transform, ParticleSystem } from '@dcl/sdk/ecs'
import {
PBParticleSystem_BlendMode,
PBParticleSystem_PlaybackState,
PBParticleSystem_SimulationSpace,
} from '@dcl/sdk/ecs'
import { Color4, Vector3, Quaternion } from '@dcl/sdk/math'
Aliases
and
ParticleSystemPlaybackState
are also exported from
and are interchangeable with the
-prefixed names.
There is no ParticleSystemSimulationSpace
alias — only
PBParticleSystem_SimulationSpace
. Prefer the
-prefixed names everywhere for consistency.
Field reference
| Field | Type | Default | Notes |
|---|
| | | Master on/off for new emission. |
| | | Particles emitted per second (continuous). Set to when using . |
| | | Hard cap on simultaneous live particles for this system. |
| | | Particle lifespan in seconds. |
| | | Multiplier on scene gravity (~ -9.81 m/s²). Negative = particles rise. |
| | — | Constant force vector applied each frame (world space). |
| | | Random size at spawn. |
| | | Size lerped start→end over particle lifetime. |
| | identity | Spawn orientation (3D). |
| | identity | Per-axis angular velocity (quaternion converted to Euler XYZ rad/s-equivalent). |
| | | Orient along velocity. Overrides . |
| | | Random color at spawn. |
| | | Color lerped start→end over lifetime. Use alpha=0 at end to fade out. |
| | | Initial speed in m/s, randomized per particle. |
| | white quad | Particle sprite. Same shape as Material textures. |
| PBParticleSystem_BlendMode
| | | | . |
| | | Particles always face camera. Disable for 3D-oriented particles. |
| {tilesX, tilesY, framesPerSecond?}
| — | Texture-atlas frame animation. defaults to 30. |
| oneof Point/Sphere/Cone/Box | Point | Emitter geometry — see below. |
| | | Loop the emission cycle. = one-shot. |
| | | Start as if one full loop has already simulated. Requires . |
| PBParticleSystem_SimulationSpace
| | (move with entity) | (stay put after spawn). |
| | — | Clamp top speed. 0–1, default = hard clamp. |
| PBParticleSystem_PlaybackState
| | | | . |
| | — | Discrete emission events (see Bursts). |
FloatRange = { start: number, end: number }
— random value sampled per particle.
ColorRange = { start: Color4, end: Color4 }
— random color sampled per particle (each end of the range is sampled independently of the other particle randoms).
Emitter shapes
Build with the
helpers — never assemble the
manually:
typescript
shape: ParticleSystem.Shape.Point()
shape: ParticleSystem.Shape.Sphere({ radius: 1 }) // default radius=1
shape: ParticleSystem.Shape.Cone({ angle: 25, radius: 1 }) // angle = half-angle in degrees
shape: ParticleSystem.Shape.Box({ size: Vector3.create(1, 1, 1) })
- Point — emits from the entity origin.
- Sphere — random points inside a sphere of .
- Cone — emits from base disk, projecting outward within half-angle. Default cone direction is the entity's local forward; rotate the parent Transform to aim it.
- Box — random points inside an axis-aligned box of .
To
rotate the emission direction (e.g. point a cone downward for snow/rain), rotate the parent entity's
. Example: snow falling from a cone uses
rotation: Quaternion.fromEulerDegrees(180, 0, 0)
on the entity, or any orientation that flips the cone axis.
Bursts
Discrete emission events at specific times. Set
to use bursts only, or combine with
for continuous + bursty.
typescript
bursts: {
values: [{ time: 0, count: 100, cycles: 1, interval: 0.01, probability: 1.0 }]
}
Burst fields:
(s from cycle start),
(particles per burst),
(default
,
= infinite),
(s between cycles, default
),
(0–1 chance per cycle, default
).
Multiple bursts in one cycle = staggered ignition pattern (fireworks).
Common patterns
Anatomy of a
definition — attach to an entity that also has a
:
typescript
const emitter = engine.addEntity()
Transform.create(emitter, { position: Vector3.create(8, 1, 8) })
ParticleSystem.create(emitter, {
rate: 20, // particles per second
lifetime: 2, // seconds each particle lives
maxParticles: 100,
initialSize: { start: 0.1, end: 0.3 }, // FloatRange sampled per particle
sizeOverTime: { start: 1.0, end: 0.0 }, // shrink to nothing over lifetime
initialVelocitySpeed: { start: 1, end: 2 },
colorOverTime: {
// fade out via alpha = 0 at end
start: Color4.create(1, 1, 1, 1),
end: Color4.create(1, 1, 1, 0),
},
shape: ParticleSystem.Shape.Point(), // emitter geometry
})
For full production-ready configurations, see
{baseDir}/references/particle-presets.md
— 17 presets: Fire Ember, Magic Aura, Snowfall, Vortex Spiral, Gravity Fountain, Bat Swarm, Tumbling Leaves, Lightning Sparks, Heavy Rain, One-Shot Burst, Asteroid Trail, Purple Swirl, Bee Swarm, Fireworks Loop, Campfire, Flame Wisps, Moving Trail. The explosion/pickup VFX (Point/Cone + ADD fire, one-shot Sphere burst) all live there — e.g.
Fire Ember (preset 1), the
One-Shot Burst explosion (preset 10), and looping
Fireworks Loop (preset 14).
Playback control
typescript
const ps = ParticleSystem.getMutable(entity)
// Pause emission and freeze existing particles
ps.playbackState = PBParticleSystem_PlaybackState.PS_PAUSED
// Resume
ps.playbackState = PBParticleSystem_PlaybackState.PS_PLAYING
// Stop and clear all live particles
ps.playbackState = PBParticleSystem_PlaybackState.PS_STOPPED
// Disable new emission (existing particles continue to live out their lifetime)
ps.active = false
Use
playbackState = PS_STOPPED
for a hard cut. Use
for a graceful trail-off.
Sprite-sheet animation
Texture atlas with frames laid out in a grid (left-to-right, top-to-bottom). Total frames =
.
typescript
texture: { src: 'assets/Images/flame-sheet.png' },
spriteSheet: { tilesX: 4, tilesY: 3, framesPerSecond: 12 } // 12 frames, plays at 12fps
Test-scene examples use
(16 frames, bat swarm @24fps),
(12 frames, fire/flame @10–12fps), and
(20-frame strip, bee @30fps) sheets.
Simulation space (local vs world)
- (default) — particles move with the emitter. A moving emitter drags its particle cloud along. Suits aura/halo effects on a moving entity.
- — particles stay at their spawn position in world space, so a moving emitter leaves a trail behind it.
For a Tween-driven emitter (verified in
, "Moving Trail"):
keeps the cloud attached to the entity as it moves; switch to
if you want the spawned particles to stay put and form a persistent trail. The test scene demonstrates the effect with
— pick the space by the look you want, not as a hard requirement.
Texture field
The
field uses the same
type as
. Common case (local file):
typescript
texture: {
src: 'assets/Images/spark.png'
}
The full Texture form supports filterMode/wrapMode but particle systems generally only need
. Avatar/Video textures on particles are unverified — stick with file textures.
Gotchas
- Texture path — particle textures default to . Same path conventions as Material textures. Legacy scenes may have them under or (still works); textures from Creator Hub asset packs land in and custom items in — reference those paths as-is.
- Quaternion rotation fields — is interpreted as per-axis angular velocity (quaternion → Euler XYZ).
Quaternion.fromEulerDegrees(0, 90, 0)
= spin 90°/s on Y. Identity = no spin.
- is world-space even when
simulationSpace = PSS_LOCAL
. Wind/drift directions stay constant regardless of emitter rotation.
- = hard clamp (particles never exceed ). Lower values let velocity exceed cap briefly then decay.
- Color.alpha = 0 at end of is the standard way to fade particles out — don't rely on ending at 0 alone.
- Bursts ignore at the moment of evaluation — is checked once per frame for continuous rate; setting it after a burst time will not retroactively cancel that burst.
- No mesh attached to the emitter entity — adding is unrelated; particles render via the ParticleSystem component itself.
Performance
- Keep low; that product is the steady-state live count.
- Disable systems out of view via
playbackState = PS_STOPPED
or .
- Prefer for opaque/translucent effects. is best for glow/fire (it stacks visually) but multi-layer additive overdraw is the most expensive case.
- Sprite sheets are cheap; multiple textures per system is not supported (one texture per system).
Resources
{baseDir}/references/particle-presets.md
— 17 ready-to-use preset configurations from the SDK7 test scene (fire, magic, snowfall, vortex, fountain, swarms, sparks, rain, bursts, fireworks, campfire, trails).
- Live tuner: (open with Decentraland client).
Example scenes
https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/0,7-particle-system
— engine-team ground truth: all 17 presets above, every shape (Point/Sphere/Cone/Box), /, continuous vs (one-shot + looping fireworks), (4×4/4×3/1×20), , / with , , , and a Tween-driven emitter demonstrating .