tracer
A round in flight. A hot head runs the span from the muzzle to what it hits at a muzzle velocity in metres per second, with a tail drawn out behind it that narrows as it falls away, and it is gone the moment it lands.
effects.play("@builtin::systems.effects.combat.tracer", {
params = { from = muzzle.position, to = hit.point, speed = 260 },
})
The round is drawn on one rod covering the whole flight path. The head is a number on an instance-data lane, so nothing about the geometry moves as the round travels — the flight is a lane write per frame.
Parameters
| Parameter | Type | Default | Range | What it changes |
|---|---|---|---|---|
from | vec3 | {0, 0, 0} | world space | Where the round starts — the muzzle. |
to | vec3 | {0, 0, 40} | world space | Where it ends — what it hits. |
speed | number | 260.0 | 5.0 – 2500.0 | Muzzle velocity in metres per second. The flight time is the span divided by it, so a longer shot at the same speed takes longer. |
width | number | 0.07 | 0.005 – 1.5 | Thickness of the streak, in metres. |
color | color | {1.0, 0.72, 0.34} | linear 0..1 | Colour of the trace. Standard runs orange, a night load runs green. |
tailLength | number | 7.0 | 0.25 – 120.0 | How far the tail is drawn behind the head, in metres. Held at the span when the shot is shorter than the tail. |
The effect's length is not a parameter: it is span / speed, which is what
stats().flightTime reports and what handle.duration is.
Cost
<!-- cost: quoted verbatim from effect.yaml -->| gpuMs | vramBytes | measuredOn |
|---|---|---|
| 0.01 | 0 | see effect.yaml |
The size is what the effect's own backends report they hold at a representative
instant — handle:stats().bytes — read identically on every engine, in every
scene and on every repeat: a tracer leases one piece of pooled geometry and
holds no simulation state of its own, so it holds no bytes, and what it costs
does not change with the span or the speed. The span is the median of five
interleaved idle/loaded windows of the frame's measured GPU pass sum, which read
0.000 ms with a spread of about 0.008 ms: the effect costs less GPU time than
that instrument resolves, and 0.01 is the bound the reading supports.
Telling it apart from the plasma bolt
The two are different effects, not one with a colour swap, and the numbers say
so. At their declared defaults over the same span a tracer's flightTime is
roughly six times shorter than a bolt's, its coreRadius is 0 where the bolt
carries a ball of a stated radius, and it leases no emitter and spawns no light
where the bolt does both.
What it draws with
| Asset | Role |
|---|---|
combat/materials/combat_glow | the family's one additive material, drawing its streak form |
combat/glow | the module that leases the rod and writes its lanes |
See also
@builtin::systems.effects.combat.muzzleFlash— the flash that sends it.@builtin::systems.effects.combat.impact— what it does where it lands.guides { path: "topics/visual-effects" }.
Scoped to this part · feeds back into the world's score.