physics_fixture_set_friction

This function sets the friction of a fixture.

Syntax:

GML Code Example

physics_fixture_set_friction(fixture, friction)


Argument Description
fixture the index of the fixture
friction the friction of the fixture must be between 0 and 1


Returns: N/A


Description

Friction is the force that resists the relative motion of material elements sliding against each other, which in the GameMaker: Studio physics world, translates as the loss of momentum caused by the collision of two instances with fixtures bound to them. So, when two instances collide, their motion is affected by this value, with a high friction causing a larger loss of momentum than a lower value.


Example:

GML Code Example

physics_fixture_set_friction(fix_Brick, 0.1);

The code above will set the friction of the fixture indexed in "fix_brick" to 0.1.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here