phy_speed_x

The x component of the speed vector.

Syntax:

phy_speed_x;


Returns: Real


Description

This variable can be used to get or to change the x component the instances linear speed vector and is defined in pixels per step (for pixels per second, see phy_linear_velocity_x). Altering this for a static instance (ie: an instance with 0 density) will turn it into a kinematic instance.


Example:

if phy_speed_x != 0
   {
   phy_speed_x = 0;
   }

The above code will check the x component of the linear speed vector and if it is anything other than 0 it will set it to 0.


Back: Physics Variables
next: phy_speed_y
© Copyright YoYo Games Ltd. 2019 All Rights Reserved