Phaser.Physics.Matter.Components.Gravity
Scope: static
Source: src/physics/matter-js/components/Gravity.js#L7
Since: 3.0.0
Static functions
setIgnoreGravity
<instance> setIgnoreGravity(value)
Description:
Sets whether this Game Object's Matter.js body should ignore world gravity. When set to true, the body will not be influenced by the global gravity defined in the Matter.js world configuration, allowing it to float freely regardless of the world's gravity settings. This can be changed at any time during gameplay to dynamically enable or disable gravity on the body.
Parameters:
| name | type | optional | description |
|---|---|---|---|
| value | boolean | No | Set to true to ignore the effect of world gravity, or false to not ignore it. |
Returns: Phaser.Physics.Matter.Components.Gravity - This Game Object instance.
Source: src/physics/matter-js/components/Gravity.js#L18
Since: 3.0.0