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
| Type | Name | Description |
|---|---|---|
bool | state | true to allow the body to sleep, false to keep it always active |
Returns
| Type | Name | Description |
|---|---|---|
bool | status | true on successful execution, false otherwise |
Examples
local entity = physics.rigid.create()
entity:set_can_sleep(false)