phy_mass

Returns the mass of the instance.

Syntax:

GML Code Example

phy_mass;


Returns: Real


Description

This read-only variable returns the mass of the instance in kilograms. This value is calculated automatically based on the surface area of the assigned fixtures and their density values, but it can be changed using the function physics_mass_properties.


Example:

GML Code Example

if phy_mass < other.phy_mass
    {
    instance_destroy();
    }
 

The above code is from the collision event of the instance with another and it compares the mass of each instance and destroys that which has less mass.





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