GPU Particles

self:set_param

Client

Sets the randomization range of a particle parameter

Syntax

local status = self:set_param(
    param,
    min,
    max = min
)

The values are sorted automatically.

  • min and max may be passed in any order — the smaller one becomes the minimum.

Parameters

TypeNameDescription
particle.gpu.paramparamParticle parameter to modify
floatminMinimum value of the parameter
floatmaxMaximum value of the parameter

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Randomize the initial velocity
local entity = particle.gpu.create()

entity:set_param(particle.gpu.param.VELOCITY, 0.5, 1.5)
Set a fixed value
local entity = particle.gpu.create()

entity:set_param(particle.gpu.param.SCALE, 0.8)

On this page