Skip to content

youbek/simple-pathfinding-unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple A* Pathfinding Algorithm. Unity3D and C#

(In the above gif, red object is acting as a player, and green object is acting as target object. All the small yellow dots represent the shortest path to the target object from player)

Class PathFinder is not a MonoBehavior class. You need to use it in your MonoBehavior class. PathFinder requires size (e.g Capsules's collider radius) to calculate collision while finding path, also LayerMask obstacles to detect obstacle GameObjects. PathFinder class doesn't require a grid. It generates nodes while searching the path. And it will keep in mind size of the object you have provided.

Todos

  • MinHeap to find node with lowest score
  • Smooth moving along the shortest paths
  • Search in Y axis
  • Freeze axis (e.g object can move only in X|Y|Z axis)
  • Caching

About

Simple pathfinding built with A* algorithm for Unity3D in C#

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages