GPU Particles

self:set_trail

Client

Draws a ribbon trail behind each particle instead of a quad

Syntax

local status = self:set_trail(
    state,
    lifetime = 0.3
)

Keep the trail lifetime below the particle lifetime.

Parameters

TypeNameDescription
boolstatetrue to draw trails, false to go back to quads
floatlifetimeHow long the trail stays behind each particle in seconds, at least 0.01

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Draw glowing sparks with trails
local entity = particle.gpu.create()

entity:set_trail(true, 0.8)
entity:set_blend_mode(particle.gpu.blend_mode.ADD)
Go back to quads
local entity = particle.gpu.create()

entity:set_trail(true)
entity:set_trail(false)

On this page