Phaser API Documentation

  Version: 
setVelocity(x, [y])

Description:

Sets the velocity of the Body.

Parameters:

name type arguments Default description
x number

The horizontal velocity of the body. Positive values move the body to the right, while negative values move it to the left.

y number <optional> x

The vertical velocity of the body. Positive values move the body down, while negative values move it up.

Returns:
Description:

This Game Object.

Since: 3.0.0