Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: Velocity
Phaser.Physics.Matter.Components.Velocity

Methods

setAngularVelocity(value)
Focus
Focus

Description:

Sets the angular velocity of the body instantly. Position, angle, force etc. are unchanged.

Parameters:

name type description
value number

The angular velocity.

Returns:
Description:

This Game Object.

Examples:
Since: 3.0.0
Focus
Focus
setVelocityX(x)
Focus
Focus

Description:

Sets the horizontal velocity of the physics body.

Parameters:

name type description
x number

The horizontal velocity value.

Returns:
Description:

This Game Object.

Examples:
Since: 3.0.0
Focus
Focus
setVelocityY(y)
Focus
Focus

Description:

Sets vertical velocity of the physics body.

Parameters:

name type description
y number

The vertical velocity value.

Returns:
Description:

This Game Object.

Examples:
Since: 3.0.0
Focus
Focus
setVelocity(x, [y])
Focus
Focus

Description:

Sets both the horizontal and vertical velocity of the physics body.

Parameters:

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 x value.

Returns:
Description:

This Game Object.

Examples:
Since: 3.0.0
Focus
Focus