Phaser API Documentation

  Version: 
setFriction(value, [air], [fstatic])

Description:

Sets new friction values for this Game Object's Matter Body.

Parameters:

name type arguments description
value number

The new friction of the body, between 0 and 1, where 0 allows the Body to slide indefinitely, while 1 allows it to stop almost immediately after a force is applied.

air number <optional>

If provided, the new air resistance of the Body. The higher the value, the faster the Body will slow as it moves through space. 0 means the body has no air resistance.

fstatic number <optional>

If provided, the new static friction of the Body. The higher the value (e.g. 10), the more force it will take to initially get the Body moving when it is nearly stationary. 0 means the body will never "stick" when it is nearly stationary.

Returns:
Description:

This Game Object.

Since: 3.0.0