GPU Particles

self:set_emission_shape

Client

Sets the shape particles are emitted from

Syntax

local status = self:set_emission_shape(
    shape,
    radius = 1,
    inner_radius = 0,
    height = 1
)

Parameters

TypeNameDescription
particle.gpu.emission_shapeshapeEmission shape to apply
float | vector3radiusSize of the shape, depending on shape:
• SPHERE / SPHERE_SURFACE - radius as a float
• BOX - extents as {x, y, z}
• RING - radius as a float
floatinner_radiusInner radius of the ring, only used by RING
floatheightHeight of the ring, only used by RING

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Emit from a sphere
local entity = particle.gpu.create()

entity:set_emission_shape(particle.gpu.emission_shape.SPHERE, 0.5)
Emit from a wide, flat box
local entity = particle.gpu.create()

entity:set_emission_shape(particle.gpu.emission_shape.BOX, {1, 0.5, 1})
Emit from a ring
local entity = particle.gpu.create()

entity:set_emission_shape(particle.gpu.emission_shape.RING, 2, 1.5, 0.2)

On this page