Sets this Body to sleep.
This Game Object instance.
Wakes this Body if asleep.
This Game Object instance.
Sets the number of updates in which this body must have near-zero velocity before it is set as sleeping (if sleeping is enabled by the engine).
name | type | arguments | Default | description |
---|---|---|---|---|
value | number | <optional> | 60 |
A |
This Game Object instance.
Enable sleep and wake events for this body.
By default when a body goes to sleep, or wakes up, it will not emit any events.
The events are emitted by the Matter World instance and can be listened to via
the SLEEP_START
and SLEEP_END
events.
name | type | description |
---|---|---|
start | boolean |
|
end | boolean |
|
This Game Object instance.
Enables or disables the Sleep Start event for this body.
name | type | description |
---|---|---|
value | boolean |
|
This Game Object instance.
Enables or disables the Sleep End event for this body.
name | type | description |
---|---|---|
value | boolean |
|
This Game Object instance.