physics_fixture_set_kinematic

This function indicates that the fixture is indicated to behave kinematically.

Syntax:

GML Code Example

physics_fixture_set_kinematic(fixture)


Argument Description
fixture the index of the fixture


Returns: N/A


Description

There will be certain instances in a physics based game which you want to move around but do not wish to be acted on by forces such as gravity, nor forces incurred by collisions with dynamic objects (think of moving platforms in a platform game, for example). For such objects simply setting the density of a fixture to 0 will mean that the physics will assume that the object is intended to be static. However, should you set the phy_speed_x, phy_speed_y or phy_angular_velocity variables for an instance that has had such a fixture bound to it, it will be converted into a kinematic object and begin movement. Change the instance from static to kinematic mid-simulation can be expensive in terms of processing (depending on the state of the instances in the physics world) and therefore it is recommended to set the fixture to be kinematic using this function prior to binding it to an instance, so that it will be unaffected by collisions and forces (such as gravity) but may move with constant linear and/or angular velocity.


Example:

GML Code Example

physics_fixture_set_kinematic(fix_Cloud);

The code above will indicate that the fixture indexed in "fix_Cloud" should be marked as kinematic.





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