Phaser API Documentation

  Version: 
setVelocity(x, [y])

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.

Since: 3.0.0