phy_linear_velocity_x

The x component of the velocity vector.

Syntax:

GML Code Example

phy_linear_velocity_x;


Returns: Real


Description

This variable can be used to get or to change the x component the instances linear velocity vector and is defined in pixels per second (for pixels per step, see phy_speed_x). Altering this for a static instance (ie: an instance with 0 density) will turn it into a kinematic instance.


Example:

GML Code Example

if phy_linear_velocity_x != 0
    {
    phy_linear_velocity_x = 0;
    }
 

The above code will check the x component of the linear velocity vector and if it is anything other than 0 it will set it to 0.





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