Phaser API Documentation

  Version: 
applyForce(bodies, force)

Description:

Applies a force to a body, at the bodies current position, including resulting torque.

Parameters:

name type description
bodies Phaser.Types.Physics.Matter.MatterBody | Array.<Phaser.Types.Physics.Matter.MatterBody>

Either a single Body, or an array of bodies to update. If falsey it will use all bodies in the world.

force Phaser.Types.Math.Vector2Like

A Vector that specifies the force to apply.

Returns:
Description:

This Matter Physics instance.

Since: 3.22.0