Skip to content

Particles

Fire, smoke, sparks, dust, rain, magic: many small things that appear, move and fade. A Particle Effect asset describes them, and a Particle Effect component plays one at an entity.

Create > Particle Effect makes an effect that already fountains particles upwards. Double- click it to open its page:

  • on the left, a tree: the effect, its systems, and each system’s emitter, initializers and behaviors;
  • in the middle, a live preview, with play controls, a speed slider, counts, and the shape it emits from;
  • on the right, the settings of what is selected.

An effect is one or more systems, each a kind of particle: a campfire might be flames, smoke and sparks. Right-click in the tree to Add System.

  • Render Mode: Billboard (flat pictures facing the camera, the usual), Stretched (stretched along their motion, for sparks and rain), Horizontal or Vertical (lying flat, or standing up), Mesh (a small mesh each: debris, leaves), Trail (a ribbon behind each particle) or Light (each particle is a small light, for fireflies and embers).
  • Texture, and Blend Mode: Alpha, Additive (glows that add up, for fire and magic), Premultiplied or Multiply.
  • Flipbook: plays a sheet of frames on each particle, its Columns and Rows, over its life or at an FPS.
  • Max Particles: the most alive at once.
  • Sim Space: World, so particles stay where they were made as the entity moves (smoke behind a car), or Local, so they move with it.
  • Soft Particles (on): particles fade where they meet surfaces, instead of cutting a hard line.
  • Prewarm Time: start as if it had already run this long, so a fire is burning when the scene opens.
  • LOD: thin it out from Start Distance and stop drawing it past Cull Distance.

Select the Emitter:

  • Mode Continuous, at Spawn Rate a second; Burst, Burst Count at once, every Burst Interval (0 is one burst), Burst Cycles times (0 forever); or both.
  • Duration (0 is forever) and Looping.

Right-click a system for Add Initializer:

  • Position: where in the emission shape it starts. Shapes are Point, Sphere, Hemisphere, Box, Cone, Ring, Circle and Edge, from the volume or only its surface.
  • Velocity: its first speed and direction.
  • Lifetime: how long it lives, between two values.
  • Color, Size, Rotation, and Mesh Orientation for meshes.

Most values are a range, picked at random for each particle.

Add Behavior adds what acts on particles as they live:

  • forces: Gravity, Drag, Wind, Turbulence, Vortex, Attractor, Radial Force;
  • Collision, bouncing off planes, spheres and boxes;
  • changes over each particle’s life: Color/Life, Alpha/Life, Size/Life, Rotation/Life, Speed/Life. Shape these with the curve, or for colour the gradient, in the settings.

Modules run in order; Move Up and Move Down reorder them.

Give an entity Add Component > Particle Effect and set its Effect. It plays at once, in the editor too. The component can swap the effect’s Mesh and Material, and for Light particles, set their Light Intensity and Light Range.

From a script:

function Torch:onTriggerEnter(other)
SceneParticles.of(self.entity.scene):restart(self.entity) -- a burst of sparks
end
  • play(entity) starts emitting; stop(entity) stops, and lets what is alive fade out.
  • restart(entity) clears it and plays it from the start: one burst, again.
  • pause(entity, true) freezes it all.
  • isPlaying(entity) is true while it emits or anything is alive.
  • setEffect(entity, effect) swaps the effect.

Each entity plays its own copy of the effect. To make a burst at a place, spawn a prefab with the effect there.