GenDistance
Generator. Generates particles based on the distance traveled by the emitter.
Each time the emitter moves a specified distance, a burst of particles is emitted. The generator interpolates the exact emission position along the emitter's path for smooth results.
This generator is ideal for trail effects where particle density should be proportional to movement speed.
In the Emitter Guide every numeric parameter of this generator is a value of its own, wired to the matching input; switching the generator type carries the shared parameters (start phase, burst) along.
Properties & inputs:
- Distance (input | property): Distance the emitter must travel to trigger one particle burst.
- Start Phase (input | property): Phase offset from 0 to 1. If 1, the first particle is emitted immediately. If 0, the emitter must travel the full distance first. An input value is read when the generator starts (and on every restart).
- Burst (input | property): Number of particles generated per emission event. An input value may be fractional: each shot emits it rounded up to whole particles; zero or a negative value emits nothing. Keep it at or below the emitter's Max. num. particles: a larger burst cannot fit into the emitter, so only as many particles as there are free slots are emitted, the rest are dropped and Burst Pos. never reaches its end. The editor marks the block with a warning in that case.
- Burst pos mode (property): Controls how the Burst Pos. output is spread across the particles of one burst. Normalized (default) runs the first particle to 0 and the last to 1 (index / (burst − 1)). Linear runs the first particle to 0 and the last to 1 − 1/burst (index / burst), so the value never quite reaches 1 — useful when Burst Pos. drives a looping or tiling gradient where the last particle should not land on the same value as the first.
Outputs:
- Burst Amount (float): Number of particles in the current burst.
- Burst Pos. (float): Position of a particle within the burst. The range depends on Burst pos mode: Normalized gives [0; 1] (last particle = 1), Linear gives [0; 1 − 1/burst] (last particle < 1).
A fractional Burst (possible only through its input) breaks these guarantees: each shot emits the value rounded up, while the outputs use the raw value — keep a connected burst a whole number.