phy_mass

Returns the mass of the instance.

Syntax:

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:

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.


Back: Physics Variables
next: phy_sleeping
© Copyright YoYo Games Ltd. 2018 All Rights Reserved