self:set_can_sleep

Client

Sets whether the rigid body is allowed to sleep when at rest


Syntax

local status = self:set_can_sleep(
    state
)

Parameters

TypeNameDescription
boolstatetrue to allow the body to sleep, false to keep it always active

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Disable sleep on a rigid body
local entity = physics.rigid.create()

entity:set_can_sleep(false)

On this page