Path Actions in GameMaker: Studio - dummies

Path Actions in GameMaker: Studio

By Michael Rohde

Paths are one of the Actions that you can assign to Objects in GameMaker: Studio. Paths are great when you want to send an Instance to travel in a specific way about the Room. This figure shows the Path Properties window and what a Path looks like.

You can start a new Path by clicking the Path icon from the menu or by right-clicking on Paths from the Resource tree. Paths are represented as a yellow line. The way points along the path are represented by colored squares and dots:

  • The green square represents the starting and end point of the path.

  • The red dot represents the selected way point.

  • The blue dots represent way points.

You can create a Path by clicking and dragging in the grid section of the Path Properties.

Use the Path Properties window to send an Instance on a specific Path.
Use the Path Properties window to send an Instance on a specific Path.

The Path Actions, as shown in the next figure, are configured directly to a Path that you create and then assign to an Action and, thus, an Object:

  • Set Path: This Action enables you to choose a Path, set the speed, determine what to do at the end of the Path, and choose whether the Path is relative or absolute. Choose Relative when you want the start point to begin where the Instance is in the Room; choose Absolute when you’ve designed the Path location in relation to the Room.

  • End Path: Use this Action to stop the Path for the Instance.

  • Path Position: Use this Action to change the current position of the Instance in the Path. You must use a value between 0 and 1, with 0 being the beginning and 1 being the end.

  • Path Speed: Use this Action to change the speed of the Instance on the Path. Negative speeds move the Instance backward. If you use 0, that will temporarily stop the motion along the path.

    The Path Actions from the Move tab.
    The Path Actions from the Move tab.