Skip to main content

ParticleSystem

ParticleSystem emits bounded screen-facing particles from Lua. Emission is global and does not require a Particle System component.

ParticleSystem.Emit(x, y, z, velocityX, velocityY, velocityZ, lifetime[, r, g, b]) emits one particle. RGB defaults to white. ParticleSystem.Clear() removes all active particles.

function Burst(gameObjectId)
local position = Transform.GetPosition(gameObjectId)
if position ~= nil then
for index = 1, 6 do
ParticleSystem.Emit(
position.x, position.y, position.z,
(index - 3) * 0.25, 1.5, 0.0,
0.65,
255, 196, 96
)
end
end
end

Emission is capped by the runtime particle pool. Avoid unbounded per-frame loops and design effects to remain readable when the pool is busy.