Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Unity NavMesh be used to implement an A* algorithm?

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.

like image 333
Rob Avatar asked Apr 13 '17 16:04

Rob


People also ask

Does Unity NavMesh use a star?

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.

What algorithm does NavMesh use?

A navigation mesh implementation is actually three algorithms : A graph navigation algorithm. A string pulling algorithm. And a steering/path-smoothing algorithm.

What is NavMesh in Unity?

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.

What pathfinding does Unity use?

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.


1 Answers

No

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.

like image 197
Draco18s no longer trusts SE Avatar answered Sep 19 '22 17:09

Draco18s no longer trusts SE