Skip to main content

Pathfinding

Events for computing and following paths on the scene collision map.

For a detailed overview of how pathfinding works, see the Pathfinding Module documentation.

Actions

Find Path

Find a path between two positions using pathfinding.
Find Path
Start X
0
Start Y
0
Goal X
0
Goal Y
0
Actor Width (tiles)
0
Actor Height (tiles)
0
Block Until Found
Path Variable
$Variable0
  • Start X / Start Y: The starting X position for pathfinding.
  • Goal X / Goal Y: The goal X position for pathfinding.
  • Actor Width (tiles): Actor footprint width in collision tiles (e.g. 2 for a 16px actor with 8px tiles).
  • Actor Height (tiles): Actor footprint height in collision tiles (e.g. 2 for a 16px actor with 8px tiles).
  • Block Until Found: If enabled, the script will wait until the path is fully computed before continuing.
  • Path Variable: Variable to store the path slot index.

Follow Path

Make an actor follow a previously found path.
Follow Path
Actor
Actor 1
Path Variable
$Variable0
Speed
Speed 2
Stop On Touch
  • Actor: The actor you want to use.
  • Path Variable: Variable to store the path slot index.
  • Movement Type: Choose if should move in horizontal/vertical axis first or if it should move diagonally to destination.
  • Speed: The movement speed.
  • Stop On Touch: Stop movement if we touch any solid surface in the movement direction, useful to avoid blocking the script.

Stop Following Path

Stop an actor from following a path.
Stop Following Path
Actor
Actor 1
Free Path
  • Actor: The actor you want to use.
  • Free Path: Also release the path slot when stopping.
  • Path Variable: Variable to store the path slot index.

Free Path

Release a path slot back to the pool.
Free Path
Path Variable
$Variable0
  • Path Variable: Variable to store the path slot index.

Get Path Length

Get the number of steps in a path.
Get Path Length
Path Variable
$Variable0
Store In
$Variable0
  • Path Variable: Variable to store the path slot index.
  • Store In: Variable to store the result.

Get Direction At Index

Get the direction at a specific index in a path.
Get Direction At Index
Path Variable
$Variable0
Index
0
Store In
$Variable0
  • Path Variable: Variable to store the path slot index.
  • Index: The step index in the path to read.
  • Store In: Variable to store the result.

Get Next Direction

Get the next direction for an actor following a path.
Get Next Direction
Actor
Actor 1
Path Variable
$Variable0
Store In
$Variable0
  • Actor: The actor you want to use.
  • Path Variable: Variable to store the path slot index.
  • Store In: Variable to store the result.

See Also

  • Pathfinding Module - Detailed module documentation, settings, and performance information