GPU Particles
self:set_collision
ClientSets how particles react when they touch the world collider
Syntax
local status = self:set_collision(
mode,
bounce = 0,
friction = 0
)Needs the world collider.
- Collider — create it once with
particle.gpu.set_world_collision, particles only collide inside the volume it covers. - Splashes — combine
HIDEwithself:set_sub_emitterto spawn another emitter's particles where each particle lands. - Bounce and friction — only used by
RIGID.
Parameters
| Type | Name | Description |
|---|---|---|
particle.gpu.collision_mode | mode | Collision mode to apply |
float | bounce | Determines how much speed is kept after a bounce Clamped between 0 and 1 |
float | friction | Determines how much a particle is slowed while sliding Clamped between 0 and 1 |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = particle.gpu.create()
particle.gpu.set_world_collision(true)
entity:set_collision(particle.gpu.collision_mode.RIGID, 0.4, 0.2)local entity = particle.gpu.create()
particle.gpu.set_world_collision(true)
entity:set_collision(particle.gpu.collision_mode.HIDE)