Phaser API Documentation

  Version: 
setVelocityX(x)

Description:

Sets the horizontal component of the body's velocity.

Positive values move the body to the right, while negative values move it to the left.

Parameters:

name type description
x number

The new horizontal velocity.

Returns:
Description:

This Game Object.

Since: 3.0.0