self:set_physics_material

Client

Applies a physics material to the rigid body, controlling friction and bounce behavior


Syntax

local status = self:set_physics_material(
    friction,
    bounce,
    rough = false,
    absorbent = false
)

Parameters

TypeNameDescription
floatfrictionFriction coefficient to apply
floatbounceBounce (restitution) coefficient to apply
boolroughWhether friction combining should favor the rougher surface
boolabsorbentWhether bounce combining should favor the less bouncy surface

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Apply a physics material on a rigid body
local entity = physics.rigid.create()

entity:set_physics_material(0.5, 0.2)

On this page