Skip to content

Particles ​

A particle emitter in the running scene.

Reached via entity.representation.particles on a particle representation. Returns null for any other representation kind.

burst() and isEmitting work on every particle representation. The other properties need an emitter built in the editor: on an imported particle file they read as null and warn when written.

Writes are runtime state: they change the running scene, not the saved experience.

Properties ​

acceleration ​

  • Type: Vector3
  • The force on each particle, in metres per second squared. Use a negative y for gravity.

birthRate ​

  • Type: number | null
  • Particles born per second while the emitter emits.

color ​

  • Type: Color
  • The colour particles are born with. Where the authored colour changes over a particle's life, writing this replaces the start colour and keeps the end colour. A random pair is replaced by the single colour written.

endColor ​

  • Type: Color
  • The colour particles fade to by the end of their life, or null when the colour does not change. Writing it to an emitter with one colour makes the colour change over a particle's life.

isEmitting ​

  • Type: boolean
  • Whether the emitter releases new particles. Turning it off lets the particles already born finish their life.

lifeSpan ​

  • Type: number | null
  • How long a particle lives, in seconds.

size ​

  • Type: number | null
  • A particle's size when it is born, in metres.

speed ​

  • Type: number | null
  • How fast a particle leaves the emitter, in metres per second.

Methods ​

burst() ​

javascript
burst(): void

Releases one burst of particles at once, as many as the emitter's burst count.

Returns: void