Builtin Library
README.md
TrailRenderer
Leaves a continuous ribbon behind a moving entity.
entity.find("spark").component.add("TrailRenderer", {
lifetime = 0.8,
widthHead = 0.3,
colorHead = { 1, 0.9, 0.4 },
colorTail = { 1, 0.2, 0.0 },
})
| field | meaning |
|---|---|
lifetime | seconds a recorded point survives |
minDistance | metres travelled before another point is recorded |
maxPoints | bound on how many points the ribbon threads through |
widthHead / widthTail | ribbon width at the subject and at the far end |
alphaHead / alphaTail | opacity at each end |
colorHead / colorTail | RGB at each end; an empty tail holds the head's |
orientation | "camera" or "fixed" |
up | the axis a "fixed" ribbon opens about |
material | the material the ribbon draws with |
| method | |
|---|---|
:clear() | drop every recorded point; the ribbon starts again |
:pointCount() | how many points the ribbon threads through |
:getPath() | the underlying path, for inspection or a custom rebuild |
:getRenderEntity() | the entity the ribbon mesh draws from |
A subject standing still records nothing, so its trail ages out and disappears rather than pooling at its feet.
Removing the component takes the ribbon and its render entity with it.