Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

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 },
})
fieldmeaning
lifetimeseconds a recorded point survives
minDistancemetres travelled before another point is recorded
maxPointsbound on how many points the ribbon threads through
widthHead / widthTailribbon width at the subject and at the far end
alphaHead / alphaTailopacity at each end
colorHead / colorTailRGB at each end; an empty tail holds the head's
orientation"camera" or "fixed"
upthe axis a "fixed" ribbon opens about
materialthe 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.