Skip to content

Trails and Sub-Emitters ​

A multi-stage firework effect created with Photon

Birth, tick, collision, and death events can chain emitters into multi-stage effects such as this firework.

The Particle Emitter can create secondary geometry and secondary emitters from each particle. These systems are powerful because they inherit particle state, but they also multiply simulation and rendering work.

Particle Trails ​

Enable Trails to attach a trail to a configured ratio of particles.

SettingPurpose
ratioFraction of spawned particles that receive a trail.
lifetimeTrail lifetime function.
dieWithParticlesRemove the trail with its owner or let it drain.
sizeAffectsWidthMultiply width by particle size.
sizeAffectsLifetimeMultiply trail lifetime by particle size.
inheritParticleColorMultiply trail color by particle color.
colorOverLifetimeColor across trail life.
trailTypeSelect the trail implementation/render geometry.

The trail has its own material/renderer path. A Particle Emitter may therefore queue tile particles and trail particles into different effective render passes.

Sub-Emitter Events ​

EventTrigger
BirthParent particle is created.
DeathParent particle finishes its lifetime, or a collision rule removes it. A collision death carries the contact point.
CollisionParent particle makes a fresh impact with a solid surface. Resting on a surface does not fire it again.
FirstCollisionParent particle makes its first impact.
TickRepeats at the configured tick interval.
TriggerEnterParent particle enters a trigger collider, or an entity in Trigger mode.
TriggerExitParent particle leaves a trigger.
Since 2.2.9 TriggerEnter and TriggerExit.Changed 2.2.9 Collision fires once per fresh impact. Before 2.2.9 it could fire again on every tick a particle stayed blocked.

Which impacts and collision deaths are reported depends on the emitter's collision Events options (Min Impact Speed, De-duplicate).

Each entry includes target emitter reference, event, probability, tick interval, and inheritance flags for color, size, rotation, lifetime, and duration. Entries also have contact options for collision, trigger, and death events:

Since 2.2.9
SettingDefaultMeaning
Spawn At Contacton for new entriesSpawn where the particle touched, not at its centre. Entries saved before 2.2.9 keep spawning at the centre.
Align To NormaloffTurn the spawned effect so its +Y follows the surface normal.
SurfaceAnyFire only for contacts with Blocks, Fluids, Entities, or Colliders. A Death without a contact never passes a filter other than Any. Birth and Tick ignore it.
Surface BlocksemptyWith Blocks or Fluids: only these blocks, as ids or #tags. Empty means any.

See Particle Collision for how contacts become events.

Search and References ​

Sub-emitters reference another emitter in the same FX runtime. Use clear, unique names and keep the target in a sensible hierarchy location. Photon resolves and caches target searches, including large hierarchies.

Avoid Recursive Explosions ​

An emitter that spawns itself, or two emitters that spawn each other, can grow without bound. Probability and interval do not make an accidental cycle safe. Design an acyclic chain and set conservative max-particle counts.

Parallel updates

Sub-emitter requests created on worker updates are queued and applied safely by the owning emitter. Custom code must not directly mutate another emitter's particle collections from a worker thread.

Released under the MIT License.