Skip to content

Trail

A fading, tapering ribbon behind a moving node (place it as a child): lifetime, width, colours.

Type: TrailNode · Category: Animation & Effects · Also found as: trail

Property Type Default Description
lifetime number 0.5 Seconds a point of the trail lasts. Range 0.05 to 10.
width number 12 Width at the head (it tapers to the tail; px). Range 0.5 to 200.
color color #ffffffdc Colour at the head.
endColor color #ffffff00 Colour at the tail (fades to it).
minDistance number 4 Distance the parent must move before a new point is recorded (px). Range 0.5 to 100.
emitting boolean true Record new points (off: the trail fades away).

Plus the common properties every node has.

Call them on the node (self.node in its script, or self.node:get_node("path")). Every node also has the Node methods.

Reads an Inspector property by its path (vectors and colours as tables); “script.” reads a field of the node’s script.

local value = self.node:get_property("lifetime")
  • path TrailNodeProperty|string

Returns any

Sets an Inspector property by its path: vectors as {x, y} or x, y; colours as {r, g, b[, a]} 0..1 or “#rrggbb[aa]”; enums by name; “script.” a field of the node’s script.

self.node:set_property("lifetime", 1.5)
  • path TrailNodeProperty|string
  • value any
  • y? number

TrailNode: drops the recorded ribbon (e.g. after a teleport).

self.node:set_position(0, 0); self.node:get_node("Trail"):trail_clear()
{
"type": "TrailNode",
"name": "Trail",
"position": [
0,
0
],
"properties": {
"lifetime": 0.5,
"width": 12,
"color": "#ffffffdc"
}
}