Skip to content

Components

Trail

A ribbon stroked behind this node's own movement: a dash streak, a thrown arc, a comet's tail, a swing's smear. Tapers head to tail width; by default it fades once stopped, or set a fixed length to keep a comet's shape while moving.

On this page

Add it

+ Add node → Trail creates a node with it already on. Already have a node for it? Add component → TrailComponent.

From a script

A script on the same node writes these fields by name. TrailComponent is the name to pass.

rgs
set_flag("TrailComponent", "emitting", true);
set_number("TrailComponent", "head_width", 10.0);
set_number("TrailComponent", "tail_width", 0.0);
set_colour("TrailComponent", "color", vec4(1.0, 1.0, 1.0, 1.0));
set_number("TrailComponent", "lifetime", 0.35);
set_number("TrailComponent", "max_length", 0.0);
set_number("TrailComponent", "min_distance", 8.0);
set_number("TrailComponent", "break_speed", 4000.0);

Fields

FieldScript nameKindDefaultWhat it does
EmittingemittingcheckboxonWhether new positions are being recorded.
Head Widthhead_widthnumber, at least 010Stroke width at the node, in world units.
Tail Widthtail_widthnumber, at least 00Stroke width at the far end.
Colorcolorcolour#ffffffColour of the ribbon.
Lifetimelifetimenumber, at least 0, step 0.050.35 sHow long a recorded position survives, in seconds.
Max Lengthmax_lengthnumber, at least 00 uHow long the drawn ribbon may be, in world units.
Min Distancemin_distancenumber, at least 08 uHow far the node must move before another position is recorded.
Break Speedbreak_speednumber, at least 04000 u/sAbove this speed, a move is treated as a teleport and the ribbon breaks.
Sort Layerlayernumber0Lower draws first.