I'm looking forward to use A* pathfinding for a game I'm working on. (I'm actually making a game for myself to learn about this). I am wondering how the Unity NavMesh can be used with a custom A* algorithm, instead of using a NavMeshAgent.
This method is very interesting because it has a large area of implementation, especially in games world. In this paper, NavMesh was implemented by using A* (A star) algorithm and examined in Unity 3D game engine.
A navigation mesh implementation is actually three algorithms : A graph navigation algorithm. A string pulling algorithm. And a steering/path-smoothing algorithm.
A NavMesh is a designated mesh in your Unity scene, which specifies navigable areas in your environment, including areas where characters can walk, as well as obstacles. This is useful for scenarios which incorporate pathfinding and AI-controlled navigation.
Characters in a game often need to navigate around obstacles in the level. Because this is such a common situation in games, Unity provides a built-in pathfinding solution, called NavMesh. In this tutorial, you'll implement point-and-click movement using NavMesh.
Or at least, not easily (why would you want to?).
Unity's builtin NavMesh is intended to be used by Unity's builtin NavMeshAgent utilizing a builtin pathfinder. I don't know what algorithm it uses, but A* implementations typically operate on networks. That is, nodes connected by edges. It does not consider the interior volume (the mesh 'faces').
As Unity's builtins are intended to be used as such, it is very difficult to get access to any of the information directly for use with your own pathfinding algorithms.
If you want to write your own pathfinder, then I recommend writing your own mesh as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With