particles2d
A visual-only 2D emitter at the node: rate, lifetime, speed, direction, spread_degrees and gravity. The live particles are renderer state the simulation…
On this page
2d · render · 18 properties · 2D
A visual-only 2D emitter at the node: rate, lifetime, speed, direction, spread_degrees and gravity. The live particles are renderer state the simulation never sees.
In a scene, particles2d is the node key that applies it. A script reaches each property below as a field on node.particles2d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.particles2d.get() and node.particles2d.set(table).
Properties
| property | type | default | description |
|---|---|---|---|
angular_speed_degrees |
float | 0 |
The fastest a particle spins, in degrees a second, counter-clockwise when positive; each takes a speed at random between zero and this |
color |
color | [1,1,1,1] |
Tint, as channel floats or #rrggbb / #rrggbbaa |
color_end |
color | [1,1,1,0] |
The tint a particle fades to by the end of its life |
direction |
vec2 | [0,1] |
Which way the particles leave; [0, 1] is straight up |
emitting |
bool | true |
Whether new particles are born; live ones finish either way |
explosiveness |
float | 0 |
How much of a one-shot burst is born at once; the rest is spread over the lifetime Range 0–1. |
gravity |
vec2 | [0,-3] |
Acceleration applied over a particle's life |
lifetime |
float | 1 |
Seconds a particle lives At least 0.05. |
material |
asset · material |
— | The material this draws with; empty takes an inherited material component, else the built-in one |
one_shot |
bool | false |
Emit one burst of rate times lifetime particles and stop; setting emitting false and true again fires another |
rate |
float | 20 |
Particles born per second At least 0. |
rotation_degrees |
float | 0 |
The most a particle is turned at birth, either way, in degrees; each takes a turn at random up to this At least 0. |
sheet |
asset · sprite_sheet |
— | A sprite_sheet whose frames each particle steps through over its life, first to last; its image is drawn when texture is empty |
size |
float | 0.1 |
A particle's edge length in world units At least 0. |
size_end |
float | -1 |
The edge length a particle grows or shrinks to by the end of its life, in world units; below zero keeps size |
speed |
float | 2 |
Initial speed in world units per second At least 0. |
spread_degrees |
float | 30 |
Half-angle of the emission cone in degrees At least 0. |
texture |
asset · texture |
— | An image, or a texture asset, each particle draws with; empty draws a flat square |
Asset types this component references: material, sprite_sheet, texture.