Sets the horizontal velocity of the physics body.
name | type | description |
---|---|---|
x | number |
The horizontal velocity value. |
This Game Object instance.
Sets vertical velocity of the physics body.
name | type | description |
---|---|---|
y | number |
The vertical velocity value. |
This Game Object instance.
Sets both the horizontal and vertical velocity of the physics body.
name | type | arguments | Default | description |
---|---|---|---|---|
x | number |
The horizontal velocity value. |
||
y | number | <optional> | x |
The vertical velocity value, it can be either positive or negative. If not given, it will be the same as the |
This Game Object instance.
Gets the current linear velocity of the physics body.
The current linear velocity of the body.
Sets the angular velocity of the body instantly. Position, angle, force etc. are unchanged.
name | type | description |
---|---|---|
velocity | number |
The angular velocity. |
This Game Object instance.
Gets the current rotational velocity of the body.
The current angular velocity of the body.
Sets the current rotational speed of the body. Direction is maintained. Affects body angular velocity.
name | type | description |
---|---|---|
speed | number |
The angular speed. |
This Game Object instance.
Gets the current rotational speed of the body. Equivalent to the magnitude of its angular velocity.
The current angular velocity of the body.