path_index

The index of the path the calling instance is following.

语法:

path_index;


Returns: ID


描述

All resources in GameMaker Studio 2 have a unique identifying number, and the path_index is a read-only variable that holds the index value for a given path resource. If the instance has no path assigned, the variable will be set to -1.


例如:

if path_index = -1
   {
   path_start(pth_enemy3, 4, path_action_reverse, 0);
   }

The above code checks to see if a path has been assigned to the instance, and if not it starts a new path (assigning it to the path_index at the same time).


上一页:路径
下一页: path_position
© Copyright YoYo Games Ltd. 2018 All Rights Reserved