Phaser API Documentation

  Version: 
setDirectControl([value])

Description:

Sets whether this Body should calculate its velocity based on its change in position every frame. The default, which is to not do this, means that you make this Body move by setting the velocity directly. However, if you are trying to move this Body via a Tween, or have it follow a Path, then you should enable this instead. This will allow it to still collide with other bodies, something that isn't possible if you're just changing its position directly.

Parameters:

name type arguments Default description
value boolean <optional> true

true if the Body calculate velocity based on changes in position, otherwise false.

Returns:
Description:

This Game Object.

Since: 3.70.0