gravity


Description

Gravity is one of the "built in" properties all instances have and, when set, will apply a constant force in the gravity direction of the instance, influencing its speed. Note that gravity is a cumulative force and will accelerate the object if you choose not to cap the final speed.


Syntax:

gravity;


Returns:

Real


Example:

if !place_meeting(x, y + 1, obj_Ground)
   {
   gravity = 0.01;
   }
else
   {
   gravity = 0;
   }

The above code will only apply gravity if the instance does not find any instances of "obj_Ground" beneath it.