Skip to content
This repository was archived by the owner on Oct 8, 2023. It is now read-only.

Latest commit

 

History

History
18 lines (14 loc) · 992 Bytes

File metadata and controls

18 lines (14 loc) · 992 Bytes

AStarUnity

Generates a series of water and grass tiles and dynamically finds the shortest path from the player to the target using the A* algorithm. Demo video included.

Usage:

  1. Download and open the AStar folder in Unity. The current Unity Project version is 2019.3.0a4
  2. Open the demoscene and click the play button
  3. A series of tiles should spawn
  4. Enable gizmos and click on the PlayerDemo GameObject in the hierarchy to show the trail
  5. You can move the player using the arrow keys or a controller and the trail will update dynamically

Note: A* allows for node weighting, and in this case the water nodes have a weight of two and the grass nodes have a weight of one. This means the path will usually steer towards grass, only crossing water tiles as necessary.

Sources: