Skip to content

Components

ParticleEmitter

Emits a stream or burst of particles, each ageing through its own size, colour, speed and spin: steam, embers, dripping water, a burst of sparks off an impact. One emitter covers all of these; only the numbers differ.

On this page

Add it

+ Add node → Particles creates a node with it already on. Already have a node for it? Add component → ParticleEmitterComponent.

From a script

A script on the same node writes these fields by name. ParticleEmitterComponent is the name to pass.

rgs
set_flag("ParticleEmitterComponent", "emitting", true);
set_number("ParticleEmitterComponent", "rate", 20.0);
set_number("ParticleEmitterComponent", "lifetime", 1.2);
set_number("ParticleEmitterComponent", "speed", 60.0);
set_point("ParticleEmitterComponent", "direction", vec2(0.0, -1.0));
set_number("ParticleEmitterComponent", "spread", 0.6);
set_number("ParticleEmitterComponent", "gravity", -40.0);
set_colour("ParticleEmitterComponent", "start_color", vec4(0.9, 0.9, 0.95, 0.8));
set_colour("ParticleEmitterComponent", "end_color", vec4(0.7, 0.75, 0.85, 0.0));
set_number("ParticleEmitterComponent", "start_size", 8.0);
set_number("ParticleEmitterComponent", "end_size", 2.0);
set_flag("ParticleEmitterComponent", "one_shot", false);
set_number("ParticleEmitterComponent", "prewarm", 0.0);
set_flag("ParticleEmitterComponent", "unshaded", false);
set_flag("ParticleEmitterComponent", "light_only", false);
set_number("ParticleEmitterComponent", "drag", 0.0);
set_point("ParticleEmitterComponent", "speed_range", vec2(0.0, 60.0));
set_number("ParticleEmitterComponent", "start_rotation", 0.0);
set_number("ParticleEmitterComponent", "rotation_spread", 0.0);
set_number("ParticleEmitterComponent", "angular_velocity", 0.0);
set_number("ParticleEmitterComponent", "angular_velocity_spread", 0.0);
set_flag("ParticleEmitterComponent", "align_to_velocity", false);
set_number("ParticleEmitterComponent", "inherit_velocity", 0.0);

Fields

FieldScript nameKindDefaultWhat it does
EmittingemittingcheckboxonWhether new particles are produced.
Rateratenumber, at least 020Particles per second.
Lifetimelifetimenumber, at least 0.011.2How long each lives, in seconds.
Speedspeednumber, at least 060Initial speed, in world units per second.
Directiondirectiontwo numbers (x, y)(0, -1)Direction particles are fired along.
Spreadspreadnumber, 0 to 7, step 0.050.6Angular scatter around direction, in radians.
Gravitygravitynumber-40Downward acceleration. Positive values pull down; negative push up.
Start Colorstart_colorcolour#e6e6f2, 80% opaqueColour at birth.
End Colorend_colorcolour#b3bfd9, 0% opaqueColour at death. Fading the alpha to zero is what makes an ember die rather than blink out.
Start Sizestart_sizenumber, at least 08Size at birth, in world units.
End Sizeend_sizenumber, at least 02Size at death.
One Shotone_shotcheckboxoffFire once and stop, rather than emitting continuously.
Burstburstnumber, at least 124How many particles a one-shot emits at once.
Capacitycapacitynumber, at least 1128The most particles that can exist at once.
Prewarmprewarmnumber, 0 to 10, step 0.10 sSeconds the emitter has already run when the room opens, so smoke is already rising.
Trailtrailnumber, 0 to 40Past positions drawn behind each particle.
Sort Layerlayernumber10Lower draws first.
Blendblendone of Alpha, Add, Multiply, Screen, SubtractAlphaAdditive for embers and sparks, multiply for smoke.
UnshadedunshadedcheckboxoffDraw at full brightness, ignoring the room's lighting.
Light Onlylight_onlycheckboxoffDraw only where light falls.
Sprite
TexturetextureassetnoneTexture each particle draws; empty draws the fallback disc.
Texture SheetsheetsectionnoneFrames laid out on texture, or nothing for one whole image.
FieldScript nameKindDefaultWhat it does
Columnscolumnsnumber, at least 1noneCells across.
Rowsrowsnumber, at least 1noneCells down.
FirstfirstnumbernoneFirst cell played, counting from zero.
LastlastnumbernoneLast cell played, inclusive.
Driverdriverone of Lifetime, SpeednoneWhat picks the frame within the range.
StretchstretchsectionnoneStretch each particle along its flight instead of drawing it square.
FieldScript nameKindDefaultWhat it does
Length Scalelength_scalenumber, at least 0, step 0.05noneLength at a standstill, as a multiple of the particle's size.
Speed Scalespeed_scalenumber, at least 0, step 0.001noneExtra length per world unit per second, as a multiple of the size.
Over Lifetime
Size Over Lifesize_over_lifesectionnoneExtra multiplier on size across a particle's life.
Color Over Lifecolor_over_lifesectionnoneExtra tint across a particle's life.
Rotation Over Liferotation_over_lifesectionnoneMultiplier on how fast a particle spins, across its life.
Velocity Over Lifevelocity_over_lifesectionnoneMultiplier on how far a particle travels this step.
Dragdragnumber, at least 0, step 0.10 /sHow much air resistance slows the particle down over time.
By Speed
Size By Speedsize_by_speedsectionnoneMultiplier on size, driven by how fast the particle is going.
Color By Speedcolor_by_speedsectionnoneTint driven by speed, multiplied in like Color Over Life.
Speed Rangespeed_rangetwo numbers (x, y), at least 0(0, 60)The speeds that map to 0 and 1 for the two by-speed curves.
Emission Shape
Shapeshapeone of Point, Circle, Box, Cone, LinePointWhere in the emitter's neighbourhood particles are born.
Rotation
Start Rotationstart_rotationnumber, step 10 °Angle a particle starts at, in degrees; a script sets it in radians.
Rotation Spreadrotation_spreadnumber, 0 to 7, step 0.050Random spread around Start Rotation, in radians.
Angular Velocityangular_velocitynumber, step 0.10 rad/sHow fast a particle spins, in radians per second.
Angular Velocity Spreadangular_velocity_spreadnumber, at least 0, step 0.10 rad/sRandom spread around Angular Velocity, in radians per second.
Align To Velocityalign_to_velocitycheckboxoffPoint each particle along its own velocity.
Sub-emitter
On Deathon_deathassetnoneAn emitter to spawn where each particle dies.
Collision
CollisioncollisionsectionnoneWhat particles do when they meet the world, or nothing to pass through.
FieldScript nameKindDefaultWhat it does
Bouncebouncenumber, 0 to 1, step 0.05none0 sticks, 1 is elastic.
Frictionfrictionnumber, 0 to 1, step 0.05none0 is ice, 1 stops it dead.
Inherit
Inherit Velocityinherit_velocitynumber, 0 to 1, step 0.050Fraction of the emitter's own velocity a new particle carries.
Noise
NoisenoisesectionnoneA noise field that bends particles off their paths, or nothing for still air.
FieldScript nameKindDefaultWhat it does
Strengthstrengthnumber, at least 0noneHow hard the field pushes, in world units per second.
Frequencyfrequencynumber, at least 0, step 0.001noneHow fine the swirl pattern is. Low is a slow, wide swirl; high is jitter.
Scrollscrolltwo numbers (x, y)noneHow fast the field itself drifts, in world units per second.
SeedseednumbernoneWhich field, of all the fields this frequency can produce.
Trigger
TriggertriggersectionnoneA region that reports the particles crossing it, or nothing.
FieldScript nameKindDefaultWhat it does
Offsetoffsettwo numbers (x, y)noneWhere the shape sits, relative to the emitter, in world units.
Shapeshapeone of Box, CirclenoneWhat the region is.
Reportreportone of Enter, Exit, BothnoneWhich crossings are reported.
Custom Data
Custom Datacustom_datasectionnoneFour per-particle numbers for a material to read, or nothing.
FieldScript nameKindDefaultWhat it does
Xxone of Fixed, Random, OverLifenoneFirst channel.
Yyone of Fixed, Random, OverLifenoneSecond channel.
Zzone of Fixed, Random, OverLifenoneThird channel.
Wwone of Fixed, Random, OverLifenoneFourth channel.