Adds a point to the given path.


path_add_point(index, x, y, speed);

Argument Description
index The index of the path to add the point to.
x The x coordinate of the new point.
y The y coordinate of the new point.
speed The speed factor of the point (default value is 100).

Returns: N/A


With this function you can add a point to the specified path and set its speed factor. This point is added onto the end of the path, irrespective of the position of the point, and the factor is equal to the percentage of path_speed that the following instance actually goes at when it reaches this point in the path. If you wish to place a path point at some other position that is not the end, you should use path_insert_point.


path = path_add();
var i;
i = 0;
   path_add_point(path0, x + lengthdir_x(50, i), y+ lengthdir_y(50, i), 100);
   i += 36;

The above code will create a circular path around the x/y position of the instance running the code.

Back: Changing Paths
Next: path_change_point
© Copyright YoYo Games Ltd. 2015 All Rights Reserved