physics_fixture_set_friction


描述

Friction is the force that resists the relative motion of material elements sliding against each other, which in the GameMaker Studio 2 physics world, translates as the loss of momentum caused by the collision of two instances with fixtures bound to them. 所以当两个实例碰撞时,它们的运动受到这个值的影响,高摩擦力将导致更大的动量损失。Note that the friction is usually set to a value between 0 and 1, but you can use any non-negative value if required.


语法:

physics_fixture_set_friction(fixture, friction)

参数 描述
fixture the index of the fixture
friction the friction of the fixture


Returns:

N/A(无返回值)


例如:

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.