Namespace: Friction

Phaser.Physics.Arcade.Components. Friction

Methods for setting the friction of an Arcade Physics Body.

In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body.

Since: 3.0.0
Source: src/physics/arcade/components/Friction.js (Line 7)
See:

Methods


setFriction(x [, y])

Sets the friction of this game object's physics body. In Arcade Physics, friction is a special case of motion transfer from an "immovable" body to a riding body.

Parameters:
Name Type Argument Default Description
x number

The amount of horizontal friction to apply, [0, 1].

y number <optional>
x

The amount of vertical friction to apply, [0, 1].

Since: 3.0.0
Source: src/physics/arcade/components/Friction.js (Line 19)
See:
Returns:

This Game Object.

Type
Phaser.Physics.Arcade.Components.Friction

setFrictionX(x)

Sets the horizontal friction of this game object's physics body. This can move a riding body horizontally when it collides with this one on the vertical axis.

Parameters:
Name Type Description
x number

The amount of friction to apply, [0, 1].

Since: 3.0.0
Source: src/physics/arcade/components/Friction.js (Line 40)
See:
Returns:

This Game Object.

Type
Phaser.Physics.Arcade.Components.Friction

setFrictionY(y)

Sets the vertical friction of this game object's physics body. This can move a riding body vertically when it collides with this one on the horizontal axis.

Parameters:
Name Type Description
y number

The amount of friction to apply, [0, 1].

Since: 3.0.0
Source: src/physics/arcade/components/Friction.js (Line 60)
See:
Returns:

This Game Object.

Type
Phaser.Physics.Arcade.Components.Friction