Version:

setDragX(value)

Sets the body's horizontal drag.

Drag can be considered as a form of deceleration that will return the velocity of a body back to zero over time. It is the absolute loss of velocity due to movement, in pixels per second squared. The x and y components are applied separately.

When `useDamping`

is true, this is 1 minus the damping factor.
A value of 1 means the Body loses no velocity.
A value of 0.95 means the Body loses 5% of its velocity per step.
A value of 0.5 means the Body loses 50% of its velocity per step.

Drag is applied only when `acceleration`

is zero.

name | type | description |
---|---|---|

value | number |
The amount of horizontal drag to apply. |

This Game Object.

Inherited from: Phaser.Physics.Arcade.Components.Drag#setDragX

Since: 3.0.0