Aego Русский

Particle System 2D

Emits visual sprites from a bounded CPU pool. World-space particles stay at their birth location when the emitter moves.

component particles.ParticleSystem2D
On this page

Usage

Add it with Create → Effects → Particle System.

Art Studio

Explosion flipbook Art Studio lessons

Try it

Particle emission rate

A prewarmed emitter with Rate zero has no particles. Its capacity is 20.

Set Rate to 40 to fill the emitter. Reset stops emission and clears the particles.

Starts the scene; open the example parameters to experiment.
Open in AegoDownload example project
Scene2 nodes
Particle emitter
Transform
position[0, 0]rotation0scale[1, 1]
Particle System 2D
playOnStartbooltrueloopbooltruedurationfloat1prewarmfloat2seedint42ratefloat0maxParticlesint20shapeenumedgeedgeAVec2[-2, 0]edgeBVec2[2, 0]lifetimeVec2[8, 8]speedVec2[0, 0]sizeVec2[0.25, 0.25]gravityVec2[0, 0]colorColor#ff9639ffspaceenumworldspriteTextureasset("ae900000000000000000000000000010")materialAssetRef<material>asset("ae900000000000000000000000000c01")orderint2
Camera
Transform
position[0, 0]rotation0scale[1, 1]
Camera 2D
activebooltruezoomfloat76viewportRect[0, 0, 1, 1]maskint-1clearbooltrueclearColorColor#17212fff

Fields

NameTypeDefaultDescription
Prewarmfloat0

Seconds of bounded preparation for a looping effect, up to two.

0 – 2
Edge AVec2(0, 0)

First endpoint in emitter coordinates.

Edge BVec2(1, 0)

Second endpoint in emitter coordinates.

MaskTexturenone

Source sprite frame. Its prepared alpha mask is independent of atlas packing.

Mask Thresholdfloat0.5

Minimum source alpha used by the sprite mask, from zero to one.

0 – 1
Frames[]assetRef[]

Ordered sprite frame references for a flipbook. Missing frames are diagnosed.

Frame FPSfloat12

Flipbook playback speed in frames per second.

≥ 0
Frame Loopbooltrue

Repeat the flipbook; otherwise hold its last frame.

Sort Modeenumage

Oldest first, youngest first or farthest first for each camera.

one of: age, youngestFirst, distance
Reduced Motionenumkeep

Keep, reduce or hide this effect when Reduce Motion is enabled.

one of: keep, reduce, hide
Reduced Ratefloat0.3

Fraction of births kept under the Reduce policy.

0 – 1
Dragfloat0

Nonnegative damping coefficient per second.

≥ 0
Noise Strengthfloat0

Magnitude of deterministic presentation noise.

≥ 0
Noise Frequencyfloat1

How fast the noise field changes.

≥ 0
Kill Y Enabledboolfalse

Remove particles on the side of increasing Y past Kill Y.

Kill Yfloat0

Threshold in simulation space, in world units.

Plane Enabledboolfalse

Remove particles past the configured clipping plane.

Plane NormalVec2(0, 1)

Outward normal of the clipping plane in simulation space.

Plane Distancefloat0

Plane offset along its normalized normal.

Color Over Life[]particles.ColorKey[]

Ordered keys for the straight color multiplier at normalized ages.

Velocity Over LifeCurvecurve

Speed multiplier by normalized age, applied without compounding.

read-only in scripts
Play On Startbooltrue

Starts the emission schedule when this emitter becomes active.

Loopbooltrue

Repeats the schedule at the end of each cycle.

Durationfloat1

Length of one emission cycle in seconds.

≥ 0
Time Domainenumgame

Game pauses with the world; unscaled uses real presentation time.

one of: game, unscaled
Seedint0

Nonzero locks the seed. Zero derives it from the session, stable node ID and activation.

Max Particlesint64

Maximum live particles. When full, keep living particles and drop excess births.

1 – 65536
Ratefloat8

Continuous births per second. Zero allows manual bursts without a continuous stream.

≥ 0
Bursts[]Vec2[]

Cycle keys as (time in seconds, birth count). Times must be in [0, duration).

≥ 0 read-only in scripts
Shapeenumpoint

Birth positions come from a point, disk, rectangle, line segment or sprite alpha mask.

one of: point, circle, rect, edge, spriteMask
OffsetVec2(0, 0)

Local offset of the emitter shape.

Rect SizeVec2(1, 1)

Full rectangle dimensions in world units.

≥ 0
Radiusfloat0.5

Circle radius in world units.

≥ 0
LifetimeVec2(0.4, 0.7)

Minimum and maximum particle lifetime in seconds.

≥ 0
SpeedVec2(0.5, 1.5)

Minimum and maximum initial speed in units per second.

≥ 0
SizeVec2(0.08, 0.16)

Minimum and maximum starting side length in world units.

≥ 0
RotationVec2(0, 0)

Minimum and maximum initial rotation in radians.

Directionfloat-1.5708

Central angle of launch in radians.

Spreadfloat1.5708

Full angular width around direction, in radians.

0 – 6.28319
ColorColorrgba(1, 1, 1, 1)

Straight linear tint and opacity at birth.

GravityVec2(0, 0)

Acceleration in units per second squared.

Size Over LifeCurvecurve

Size multiplier sampled at normalized particle age.

read-only in scripts
Alpha Over LifeCurvecurve

Opacity multiplier sampled at normalized particle age.

read-only in scripts
Rotation Speedfloat0

Angular speed in radians per second.

Spaceenumlocal

Local particles follow the emitter; world particles keep their birth transform.

one of: local, world
SpriteTexturenone

Texture region to draw. Empty uses the built-in white texture.

MaterialAssetRef<material>none

Optional unlit sprite-domain material. Its shader controls the blend mode.

Layerint0

Painter layer shared with SpriteRenderer and Mesh2D.

Orderint0

Painter order within the layer.

Methods

Burst method

func (ParticleSystem2D) Burst(count int)

Requests count births at the emitter. Does not start automatic emission.

Example

Dust.Get<ParticleSystem2D>().Burst(8)

Clear method

func (ParticleSystem2D) Clear()

Removes live particles without changing the emission schedule.

Count method

func (ParticleSystem2D) Count() int

Returns the current number of living particles on the emitter.

Emitting method

func (ParticleSystem2D) Emitting() bool

Reports whether automatic emission is running.

Play method

func (ParticleSystem2D) Play()

Starts automatic emission. Repeating Play while emitting does nothing.

Playing method

func (ParticleSystem2D) Playing() bool

Reports whether the schedule is running or particles remain.

Restart method

func (ParticleSystem2D) Restart()

Clears live particles and starts a new emission schedule.

Stop method

func (ParticleSystem2D) Stop()

Stops new emissions and lets live particles drain.

StopAndClear method

func (ParticleSystem2D) StopAndClear()

Stops automatic emission and immediately removes living particles.

Signals

Completed signal

signal Completed()

A finite emission schedule has ended and its last particle expired. A presentation signal, not a gameplay timer.