path_orientation

Sets the rotation of the path.

Syntax:

path_orientation;


Returns: Real.


Description

This variable holds the current orientation of the path. When a path is created, its orientation is the default 0 degrees, but you can set this value to anything you wish using this. Remember that in GameMaker: Studio (unless you are using physics) the angles are calculated counter-clockwise, so setting the path orientation to 90° would rotate the path to the left.




Example:

mypath = path_duplicate(choose(path_1, path_2, path_3, path_4));
path_orientation = 90;

The above code duplicates a random, pre-made path resource into the variable "mypath". This new path is then rotated 90°.


Back: Changing Paths
Next: path_endaction
© Copyright YoYo Games Ltd. 2018 All Rights Reserved