phy_speed

Returns the speed of the physics enabled instance.

Syntax:

GML Code Example

phy_speed;


Returns: Real


Description

This read-only variable returns the speed as a value in pixels-per-second of the physics enabled instance. Should you need to change this value, you must do so by changing the x and y vectors using the variables phy_speed_x and phy_speed_y.


Example:

GML Code Example

if phy_speed > 10
    {
    phy_linear_damping += 0.01;
    }
 else
    {
    phy_linear_damping = 2;
    }
 

The above code checks the speed of the physics enabled instance and then changes the linear damping based on the returned value.





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