Skip to main content

Particles

Particles are many tiny sprites that make effects: fire, smoke, sparkles, explosions, dust, rain, confetti, magic.

Add an effect​

Objects → + Add → Particles and pick a preset. It starts previewing in the 3D view right away.

Particle presets in the Add menu
Particle presets in the Add menu
Or: Preset → Start from a preset…
Or: Preset → Start from a preset…
PresetLook
✨ SparklesTwinkling glitter around the object
🔥 FireFlickering flames rising up
💨 SmokeSlow grey puffs that grow and fade
💥 ExplosionOne big burst (plays once)
🌫️ Dust puffSmall puff for landings and footsteps (plays once)
🌧️ RainFalling drops over a big area (place it high up)
🎉 ConfettiColorful party burst (plays once)
💦 SplashWater thrown up when something falls in (plays once)
🫧 BubblesLittle bubbles and froth on the water (swimmers leave them behind)
🔮 MagicGlowing orbs drifting upward

Particles settings​

The Particles component is laid out like Unity's Particle System: the main settings, then a list of modules. Tick a module to switch it on; tap its name to open it. If you know Unity, every module and field has the same name and does the same thing.

Preset → Start from a preset… replaces every setting with a ready-made effect. ▶ Preview plays it in the editor; edits show while it plays. Selecting an object with particles plays its preview by itself; ■ Stop keeps it stopped until you select the object again.

Most numbers have a little menu next to them, as in Unity:

ModeMeans
ConstantOne value.
CurveChanges over time: over the particle's lifetime for most settings, over the system's Duration for start values.
Random Between Two ConstantsEach particle picks its own value between Min and Max.
Random Between Two CurvesEach particle picks a value between two curves.

Colours have the same idea: Color, Gradient, Random Between Two Colors / Gradients, Random Color.

particles modules

Particle System (main)​

FieldWhat it does
Duration / LoopingLength of one cycle in seconds; Looping starts the next one straight away. Prewarm starts a looping effect as if it had already run a cycle.
Start DelayWait before it starts emitting.
Start LifetimeSeconds each particle lives.
Start SpeedSpeed it is shot out at, along the Shape's direction.
Start Size (or 3D Start Size)Size when born (per axis with 3D).
Start Rotation (or 3D) / Flip RotationAngle when born; share of particles spinning the other way.
Start ColorColour when born.
Gravity Modifier1 = falls like objects, 0 = floats, negative = rises.
Simulation SpaceLocal: particles move with the object. World: they stay where they were made (smoke trails, sparks from a moving car). Custom: move with another object.
Simulation SpeedPlays the whole effect faster or slower.
Delta TimeUnscaled keeps playing while the game is in slow motion or paused by time scale.
Scaling ModeWhether the object's scale (and its parents') sizes the particles.
Play On AwakeStarts with the scene. Off = wait for Start particles.
Simulate OnCPU (every module) or GPU: up to a million particles, worked out on the graphics card. See GPU particles.
Max ParticlesLimit for this effect: up to 5,000 on the CPU, 1,048,576 on the GPU. Lower is faster on old phones.
Stop ActionWhen a one-shot effect is done: nothing, Disable or Destroy the object, or Callback (fires On particles stopped).
particles main

Modules​

Emission
Emission
Shape
Shape
ModuleWhat it does
EmissionRate over Time (per second), Rate over Distance (per meter the object moves: footprints, tire smoke) and Bursts (a number at a time, repeated in cycles).
ShapeWhere particles are born and which way they go: Sphere, Hemisphere, Cone, Donut, Box, Mesh (a model's surface), Circle, Edge, Rectangle. Position, rotation and scale move the shape off the object.
Velocity over LifetimeExtra speed along X/Y/Z, orbiting around a point, or out from the middle (Radial).
Limit Velocity over LifetimeCaps the speed and adds Drag (air resistance).
Inherit VelocityParticles take some of the object's own movement.
Lifetime by Emitter SpeedA moving object's particles live longer or shorter.
Force over LifetimeA steady push along X/Y/Z, like wind.
Color over Lifetime / by SpeedColour and transparency change as the particle ages, or with its speed.
Size over Lifetime / by SpeedGrows or shrinks as it ages, or with its speed.
Rotation over Lifetime / by SpeedSpins as it ages, or with its speed.
External ForcesLets force fields push the particles.
NoiseTurbulence: wobbly, swirling paths (fire, smoke, magic).
CollisionParticles bounce off Planes you pick, or off the World (any collider), losing speed or life on each hit.
TriggersDo something when particles are inside / outside / enter / leave chosen colliders: kill them, or fire an event.
Sub EmittersAnother Particle System fires where particles are born, die or collide (a firework that bursts at the top).
Texture Sheet AnimationPlays frames of a sprite sheet on each particle (flickering flames, animated smoke).
LightsGives some particles a real light (glowing sparks). Costly: keep Max Lights small on phones.
TrailsEach particle leaves a ribbon behind it, or ribbons join the particles together.
Custom DataValues per particle for your own particle shader.

Renderer​

FieldWhat it does
Render ModeBillboard (always faces the camera), Stretched Billboard (streaks along its movement: rain, sparks), Horizontal / Vertical Billboard, Mesh (a shape or model per particle: confetti, debris), None.
ShaderBuilt-in, or a project shader (see Custom Data and particle shaders).
TextureA picture per particle; none = a soft round dot (billboards) or plain colour (meshes).
BlendingAlpha (smoke, confetti), Additive (glow) (fire, sparks, magic), Premultiply, Multiply (darkening).
Render AlignmentWhich way billboards face: the view, the camera itself, the world or object axes, or along their velocity.
Sort ModeDraw order of the particles: by distance, oldest or youngest in front.
Order in LayerDraw order against other see-through things.
Min / Max Particle SizeKeeps particles between these sizes on screen (share of the screen height).
Flip / PivotMirror a share of particles; move the quad off the particle's centre.
particles renderer

Particles from events and scripts​

  • Actions (category Particles): Start, Restart, Stop, Pause and Clear particles, Burst particles (N at once), Emit particles with values (N with their own speed, colour, size…), Set particle rate, Set particle start color, Set particle start value, Turn particle module on/off, Spawn particles here (a one-off effect at the object) and Spawn particles (a preset at any position — great for an explosion where something was destroyed).
  • Conditions: Is emitting / playing / paused, Compare particle count, On particle collision, On particles stopped.
  • Scripts: entity.particleSystem is Unity's ParticleSystem — every module live (entity.particleSystem.main.startSpeed = 8, entity.particleSystem.noise.enabled = true), plus play(), stop(), emit(count, params), getParticles() / setParticles(). One-off effects: game.spawnParticles('Explosion', x, y, z), with settings changed by module: game.spawnParticles('Sparkles', x, y, z, { main: { startColor: '#66ccff' } }).

The project’s Max particles setting caps all effects together. See Performance.

GPU particles​

Set Simulate On to GPU for effects with tens of thousands of particles or more: snow over a whole level, a waterfall, a galaxy, sparks by the hundred thousand. It is the same Particle System with the same settings, but once a particle is born the graphics card moves it, ages it and draws it, so a million particles can run at full speed on a desktop.

Particles are born the same way: every Shape, Burst and start value, and Emit particles with values, work as on the CPU. The graphics card makes the new particles itself too, so a burst of 500,000 costs the game no more than a burst of 5. That includes a Mesh shape (of up to 65,536 triangles) and the bursts a GPU sub emitter fires from its parent's particles (8 or more at a time; a few at a time are made on the CPU, which is quicker for so few). Only these are still made one by one on the CPU (up to 65,536 a frame): Emit particles with values, a Mesh shape on a GPU sub emitter, and a Mesh shape with more triangles than that.

The graphics card then runs these modules:

  • Gravity, Velocity over Lifetime (orbit and radial too), Limit Velocity over Lifetime (drag), Inherit Velocity, Force over Lifetime
  • External Forces: up to 4 force fields and wind zones
  • Noise
  • Collision with up to 6 Planes
  • Color, Size and Rotation over Lifetime and by Speed
  • Texture Sheet Animation, and every Render Mode (billboards, stretched, mesh)

A GPU effect skips the modules marked CPU in the Inspector: Triggers, Sub Emitters (a GPU effect can still be a sub emitter of a CPU one), Lights, Trails and Custom Data, and Collision with the World. It also skips Sort Mode and Ring Buffer Mode. When it is full, no new particles are born until old ones die.

Some things work differently with a GPU effect:

  • The project’s Max particles setting doesn't count GPU effects: each one has its own Max Particles.
  • Scripts can't read or move single particles (getParticles() returns an empty list), and Compare particle count counts every particle that may still be alive.
  • New particles can fill every free slot in one frame (the 65,536-a-frame limit is only for the ones made on the CPU, see above).
  • A device that can't render to float textures (some old phones) runs the effect on the CPU instead, with the CPU's limit of 5,000.

Force fields​

A Particle force field pushes, pulls or swirls particles that pass through it: wind, a whirlpool, a black hole, a magic vortex. It works like Unity's Particle System Force Field.

  1. Make an object for the field (Objects → + Add → Empty object), then Add component → Particle force field. The editor draws its range as purple rings.
  2. On the Particle System, open External Forces and tick it. Only systems with External Forces on are pushed.
Particle force field
Particle force field
External Forces on the Particle System
External Forces on the Particle System

Force field settings

FieldWhat it does
ShapeSphere, Hemisphere (top half only), Cylinder (along the object's Y axis) or Box.
Start Range / End RangeThe field works between these distances from its middle. Start Range above 0 leaves a hole in the middle. For a box, End Range is half its size.
LengthCylinder height.
Direction X / Y / ZA steady push along the object's own axes, like wind. Turn the object to turn the wind.
Gravity → StrengthPulls particles to the middle; negative pushes them away.
Gravity → Gravity Focus0 pulls to the middle, 1 to the outer edge, so particles gather on a shell (or a ring for a cylinder).
Rotation → SpeedSwirls particles around the object's Y axis, in radians per second (3.14 = half a turn a second).
Rotation → Attraction0 to 1: how hard swirling particles are drawn into the middle of the vortex.
Drag → StrengthSlows particles down inside the field, optionally more for big or fast ones.

Every force can be a constant, a curve over each particle's lifetime, or random, like other particle values. The ranges grow with the object's scale.

External Forces (on the Particle System)

FieldWhat it does
MultiplierScales every field's forces for this system (0 = not pushed, 2 = twice as hard).
Influence FilterEverything = every field in the scene; List = only the fields you add to Influence List.

The preview in the editor shows the fields' effect too. From a script: entity.particleSystem.externalForces.multiplier = 2, or entity.addComponent('forceField', { endRange: 4, rotationSpeed: 3 }).

Wind zones​

A Wind zone blows on every Particle System with External Forces on: smoke leaning over, sparks carried off, leaves drifting. It works like Unity's Wind Zone. Scripts can read it too, so flags, sails and trees can sway with the same wind.

  1. Make an object for the wind (Objects → + Add → Empty object), then Add component → Wind zone. The editor draws teal arrows the way it blows, or the sphere it fills.
  2. On the Particle System, tick External Forces. Wind zones always count, whatever the Influence List says; the list only picks force fields.
FieldWhat it does
ModeDirectional: blows along the object's forward (its blue axis pointing away, -Z) everywhere in the scene; turn the object to turn the wind. Spherical: blows outwards from the object, strongest in the middle and fading to nothing at Radius.
RadiusSpherical only: how far it reaches. It grows with the object's scale.
MainHow hard it blows (meters per second², a steady push).
TurbulenceGusts: the wind changes direction and strength from place to place and moment to moment, smoothly, so neighbouring particles sway together.
Pulse MagnitudeHow much the strength swells and drops: 0 steady, 0.5 between half and one and a half times Main.
Pulse FrequencySwells per second (0.01 = one every 100 seconds, 1 = every second).

Several wind zones add up. External Forces → Multiplier scales the wind for that system too.

From a script, game.windAt(x, y, z) gives the wind at a point as { x, y, z } (pulses and gusts included):

export function update(dt: number) {
const w = game.windAt(entity.position.x, entity.position.y, entity.position.z);
entity.rotation.z = w.x * 3; // a flag or a tree leans with it
}

The Gizmos menu's Force fields & wind switch shows or hides the purple and teal guides.

Custom Data and particle shaders​

A Particle System can draw with your own shader instead of the built-in soft dot: pick it in Renderer → Shader. The engine still places each particle; your shader's fragment part colours it. The shader's own settings show as fields under the Shader picker.

Custom Data sends values per particle to that shader, like Unity's Custom Data module and custom vertex streams. Turn the module on and set Custom1 and/or Custom2:

Custom Data with Custom1 as a Vector
Custom Data with Custom1 as a Vector
ModeGives the shader
DisabledNothing new (a value a script set stays).
Vector1 to 4 numbers (X, Y, Z, W), each a constant, a curve over the particle's lifetime, or random. The rest are 0.
ColorA colour (or gradient over its lifetime) as rgba.

In the shader, declare what you use:

NameIs
varying vec2 vUvPosition on the particle's quad (0 to 1); with a texture sheet, on its frame.
varying vec4 vColorThe particle's colour after every module.
varying vec4 vCustom1, vCustom2Custom Data streams 1 and 2.
varying float vAgePercent0 when the particle is born, 1 when it dies.
uniform float uTimeSeconds since the scene started.
uniform sampler2D uMap, uniform float uHasMapThe Renderer's texture, and 1 when it has one.

Example: burning particles. Files → New → Shader → Particle dissolve. On the Particle System pick it in Renderer → Shader, turn on Custom Data, set Custom1 to Vector with X as a curve from 0 up to 1. Each particle burns away with a glowing edge as it gets older.

From a script, Unity's calls: entity.particleSystem.getCustomParticleData(1) gives { x, y, z, w } per particle, setCustomParticleData(list, 1) sets them (leave that stream Disabled so the module does not overwrite it).

Only the fragment part of the shader is used on particles; the engine's own vertex part places them.

Trail renderer​

A Trail renderer leaves a ribbon behind an object as it moves: sword swings, dashes, bullets, comets, tire marks. Like Unity's Trail Renderer, it is a component: Add component → Trail renderer. The trail appears when the game runs and the object moves. In the editor, moving the object in the 3D view draws its trail too, which then fades.

FieldWhat it does
WidthThe ribbon's width (the number) and its shape along the trail (the curve: left = at the object, right = the tail).
Time (s)How long each bit of trail lasts before it is gone.
Min vertex distanceHow far the object moves before the trail adds a point. Smaller = smoother, more work.
AutodestructDestroy the object once it has stood still for Time and its trail is gone. Handy for projectiles.
EmittingOff: no new trail (what is there fades).
ColorGradient from the object to the tail; transparency fades it out.
AlignmentView: the ribbon always faces the camera. Transform Z: it lies flat, facing the object's Z axis (blade trails).
Texture modeHow the texture runs along it: Stretch once over the whole trail, Tile every meter, Distribute / Repeat Per Segment once over / once per piece.
TextureA picture along the ribbon; none = plain colour.
BlendingAdditive glows (sparks, magic, lasers).
Corner Vertices0 = sharp corners. More (up to 16) rounds each bend with that many extra points; the ribbon then runs just inside the exact corner.
End Cap Vertices0 = square ends. More (up to 16) rounds both ends into half circles.
card trail

Sword trail: put an empty object on the blade (a child of the sword), add a Trail renderer with Time about 0.2, Width about the blade length, Alignment → Transform Z and Additive blending. Turn the empty so its Z axis points across the swing.

Blocks: Turn trail on/off and Clear trail (category Effects). Scripts: entity.trailRenderer.emitting = false, entity.trailRenderer.clear() (after teleporting, so no streak joins the two places), positionCount, getPositions().

Line renderer​

A Line renderer draws a ribbon through a list of points: lasers, lightning, ropes, aim lines, outlines. Add component → Line renderer. Unlike a trail, it shows in the editor too.

FieldWhat it does
LoopJoin the last point back to the first (a ring, an outline).
Use world spaceOff: points are in the object's own space and move, turn and scale with it. On: points are world positions and stay put.
PositionsThe points. ✕ removes one; + Add point carries on in the last direction.
Width, Color, Alignment, Texture mode, Texture, Blending, Corner Vertices, End Cap VerticesAs for the Trail renderer, from the first point (left of the curve) to the last. A loop has no ends, so no end caps.
card line

Editing in the 3D view: tap the line to select it (anywhere along it, even a thin one). Each point then shows as an orange dot: drag a dot to slide the point over its height, or Shift + drag (mouse) to move it up and down. A tapped dot turns white and gets the move arrows, for moving it along one axis. Add and remove points on the card.

Laser: a Line renderer with two points and Use world space on, on the gun. Every frame, set point 0 to the gun and point 1 to where a raycast hits (or 50 m ahead):

function update(dt) {
const lr = entity.lineRenderer;
const dir = entity.getForward();
const hit = game.raycast(entity.position, { direction: dir, length: 50 });
const p = entity.position;
lr.setPosition(0, p);
lr.setPosition(1, hit ? hit.point : { x: p.x + dir.x * 50, y: p.y + dir.y * 50, z: p.z + dir.z * 50 });
}

Blocks: Set line point (a point past the end makes the line longer) and Set line point count (category Effects). Scripts: setPosition(i, v), setPositions([...]), getPosition(i), getPositions(), positionCount, and every setting, e.g. entity.lineRenderer.width.scale = 0.05.