YoYo Games Wiki

gravity

From YoYoGames Wiki

Description

(real): the acceleration of a given instance in a certain direction.

Explanation

The local variable gravity defines the acceleration in a certain direction for an instance. Usually, you'll want this direction to be 270°, being downwards. You can change it by setting the variable gravity_direction The gravity is set in pixels per step. Each step, the amount of pixels will be added to the instance's speed.