GPU Particles

particle.gpu.set_world_collision

Client

Creates or removes the world collider that particles collide with

Syntax

local status = particle.gpu.set_world_collision(
    state,
    size = {48, 60, 48},
    resolution = 1024
)

One shared collider, no baking and no map setup.

  • Follows the camera — stays centred on the active camera and covers the level around it.
  • Top surface only — roofs, ceilings and ledges stop particles, the ground beneath them stays untouched.
  • Opt-in — emitters collide only after self:set_collision.
  • Layers — reads visual layers 1 to 19, emitters live on layer 20.
  • Cost — doubling the resolution quadruples the pixels redrawn when the collider moves.

Parameters

TypeNameDescription
boolstateDetermines the collider state:
• When true - creates the collider, or updates it if it already exists
• When false - removes the collider
vector3sizeSize of the covered volume in metres as {x, y, z}:
• x and z - the area around the camera
• y - the height of the volume, centred on the camera
intresolutionHeight map size in pixels, rounded up to 256, 512, 1024, 2048, 4096 or 8192

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Create the world collider with the defaults
particle.gpu.set_world_collision(true)
Cover a larger area with a sharper height map
particle.gpu.set_world_collision(true, {80, 60, 80}, 2048)
Remove the world collider
particle.gpu.set_world_collision(false)

On this page