Collider:isSleepingAllowed
EditReturns whether the Collider is allowed to sleep.
allowed = Collider:isSleepingAllowed()
Arguments
None
Returns
Name | Type | Description |
allowed | boolean | Whether the Collider can go to sleep. |
Notes
If sleeping is enabled, the simulation will put the Collider to sleep if it hasn't moved in a while. Sleeping colliders don't impact the physics simulation, which makes updates more efficient and improves physics performance. However, the physics engine isn't perfect at waking up sleeping colliders and this can lead to bugs where colliders don't react to forces or collisions properly.
It is possible to set the default value for new colliders using World:setSleepingAllowed
.
Colliders can be manually put to sleep or woken up using Collider:setAwake
.
See also
World:isSleepingAllowed
World:setSleepingAllowed
Collider:isAwake
Collider:setAwake
Collider:setSleepingAllowed
Collider