Skip to content

Particle Emitter

2D particle burst and fountain generator with customizable speed, spread, lifetime, and colors.

Type: ParticleEmitterNode · Category: Animation & Effects · Also found as: particle, particles, particleemitter

Property Type Default Description
emitter.amount integer 100 Particles alive at once (the pool size). Range 1 to 5000.
emitter.lifetime number 2 Seconds each particle lives. Range 0.01 to 5.
emitter.position vec2 (0, 0) Emitter position (follows the node). Range 0 to 1280. Runtime state: read-only, not saved.
emitter.burst number 0.5 0 spreads emission evenly over the lifetime, 1 releases every particle at once. Range 0 to 1.
emitter.size vec2 (5, 5) Particle size (px). Range 0.01 to 100.
emitter.sizeVariance number 0 How much of Size Spread is applied at random (0-1). Range 0 to 1.
emitter.sizeSpread number 0 Largest random size change (px). Range 0 to 50.
emitter.scaleStart vec2 (1, 1) Scale at birth (multiplies Size). Range 0 to 1.
emitter.scaleEnd vec2 (1, 1) Scale at death; it interpolates over the lifetime. Range 0 to 1.
emitter.rotation number 0 Starting rotation (degrees). Range 0 to 359.
emitter.rotationVariance number 0 How much of Rotation Spread is applied at random (0-1). Range 0 to 1.
emitter.rotationSpread number 0 Largest random rotation change (degrees). Range 0 to 359.
emitter.torque number 0 Spin speed (degrees/s). Range -2000 to 2000.
emitter.torqueVariance number 0 How much of Torque Spread is applied at random (0-1). Range 0 to 1.
emitter.torqueSpread number 0 Largest random spin change (degrees/s). Range 0 to 2000.
emitter.torqueAcceleration number 0 Change in spin speed per second. Range -2000 to 2000.
emitter.useColorRamp boolean true Colour over the lifetime from the colour ramp (else Particle Color to Color End).
emitter.particleColor color #ffffffff Colour at birth.
emitter.colorEnd color #ffffffff Colour at death.
emitter.colorVariance number 0 Random colour variation (0-1). Range 0 to 1.
emitter.spread vec2 (0, 0) Particles start anywhere within ± this box around the emitter (px). Range 0 to 1280.
emitter.velocity number 100 Starting speed (px/s). Range 0 to 2000.
emitter.velocityVariance number 0 How much of Velocity Spread is applied at random (0-1). Range 0 to 1.
emitter.velocitySpread number 0 Largest random speed change (px/s). Range 0 to 2000.
emitter.velocityScale number 1 Multiplies every particle’s movement (slow motion < 1). Range 0 to 10.
emitter.acceleration number 0 Change in speed per second along the direction of travel. Range -2000 to 2000.
emitter.angle number 0 Emission direction (degrees; 0 = right, 90 = down). Range 0 to 359.
emitter.angleVariance number 0 How much of Angle Spread is applied at random (0-1). Range 0 to 1.
emitter.angleSpread number 0 Largest random change to the angle (± degrees; 180 = all round). Range 0 to 360.
emitter.gravityDirection vec2 (0, 1) Direction gravity pulls particles. Range -1 to 1.
emitter.gravityVelocity number 200 Strength of that gravity (px/s²). Range -2000 to 2000.
emitter.wind vec2 (0, 0) Constant drift added to every particle (px/s). Range -1000 to 1000.
emitter.collisionEnabled boolean false Particles bounce off physics colliders.
emitter.elasticity number 0.7 Bounciness when colliding (0 stops, 1 keeps all speed). Range 0 to 1.
emitter.shape enum: Circle, Ellipse, Rectangle, Pixel, Line, Texture, Custom Circle Shape each particle is drawn as. Range 0 to 2000.
emitter.emitting boolean true Emit new particles (existing ones finish their lives).
emitter.continuous boolean true Keep emitting (else one cycle, then stop).

Plus the common properties every node has.

Call them on the node (self.node in its script, or self.node:get_node("path")). Every node also has the Node methods.

Reads an Inspector property by its path (vectors and colours as tables); “script.” reads a field of the node’s script.

local value = self.node:get_property("position")
  • path ParticleEmitterNodeProperty|string

Returns any

ParticleEmitterNode:set_property(path, value, y)

Section titled “ParticleEmitterNode:set_property(path, value, y)”

Sets an Inspector property by its path: vectors as {x, y} or x, y; colours as {r, g, b[, a]} 0..1 or “#rrggbb[aa]”; enums by name; “script.” a field of the node’s script.

self.node:set_property("position", 100, 50)
  • path ParticleEmitterNodeProperty|string
  • value any
  • y? number

Starts continuous or burst particle emission.

self.node:get_node("Sparks"):particle_start()

Stops particle emission.

self.node:get_node("Sparks"):particle_stop()

ParticleEmitterNode:particle_is_emitting()

Section titled “ParticleEmitterNode:particle_is_emitting()”

Checks if particles are actively being emitted.

local fx = self.node:get_node("Smoke"); if not fx:particle_is_emitting() then fx:particle_start() end

Returns boolean

ParticleEmitterNode:particle_set_amount(amount)

Section titled “ParticleEmitterNode:particle_set_amount(amount)”

Sets the maximum particle pool count for this emitter.

self.node:get_node("Sparks"):particle_set_amount(64)
  • amount integer

ParticleEmitterNode:particle_set_lifetime(lifetime)

Section titled “ParticleEmitterNode:particle_set_lifetime(lifetime)”

Sets the base lifetime in seconds for newly spawned particles.

self.node:get_node("Sparks"):particle_set_lifetime(1.5)
  • lifetime number
{
"type": "ParticleEmitterNode",
"name": "ParticleEmitter",
"position": [
0,
0
]
}