GPU Particles
particle.gpu.set_world_collision
ClientCreates 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
1to19, emitters live on layer20. - Cost — doubling the
resolutionquadruples the pixels redrawn when the collider moves.
Parameters
| Type | Name | Description |
|---|---|---|
bool | state | Determines the collider state: • When true - creates the collider, or updates it if it already exists• When false - removes the collider |
vector3 | size | Size 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 |
int | resolution | Height map size in pixels, rounded up to 256, 512, 1024, 2048, 4096 or 8192 |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
particle.gpu.set_world_collision(true)particle.gpu.set_world_collision(true, {80, 60, 80}, 2048)particle.gpu.set_world_collision(false)