phy_angular_velocity

Gets or sets the angular velocity of an instance.

Syntax:

GML Code Example

phy_angular_velocity;


Returns: Real


Description

This variable can be used to set the angular velocity of the instance, or it can be used to get the current angular velocity, in degrees per second and the value used can be either positive (for clockwise rotation) or negative (for anticlockwise rotation). If you set this on an instance that was previously static (ie: it has a density of 0) it will become a kinematic object and begin rotating.


Example:

GML Code Example

if abs(phy_angular_velocity) > 0
    {
    phy_angular_velocity -= sign(phy_angular_velocity) * 0.01;
    }
 else
    {
    phy_angular_velocity = 0;
    }
 

The above code will check the angular velocity of the instance and if it is not 0 it will then add (or subtract) a small amount every step until the value is 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