- Home /
Complete Pathfinding Understanding in Unity
Hello everyone,
As written on the title, I wanted to ask a guide way to my understanding. So my question is after I create a navmesh system in Unity, is there any way to access the nodes or points etc. data ? I want to write my own search algorithm without dealing with graph creating etc. I think Unity is using A star for pathfinding. I only want to focus writing my own search algorithm. Any other suggestions are gladly accepted. Thank you.
Answer by Bunny83 · Mar 02, 2019 at 11:29 AM
Unity uses a NavMesh. You should understand that navigating a navmesh (properly) is slightly more complex than navitaging a simple node tree. However you can get the mesh data of the navmesh by using NavMesh.CalculateTriangulation. Then you got the vertices, triangles and the area relation of each triangle. See NavMeshTriangulation for more details.
You can use A* for navigation, though the result probably needs to be "refined", otherwise you would always follow the nav mesh edges. Here's an article about how you may want to navigate a navmesh
Answer by Metalian · Mar 02, 2019 at 12:31 PM
So in that case it is possible to do with Unity Navmesh. A* is not an option for me to use but a guide. Due to an academic research using concrete algorithms are not allowed, I have to find a different approach it is not mandatory to be opitimal. If I am able to use the data of navmesh then even tough the motion etc. is not organic, I am ok with that. I searched a little bit and either people used a completely seperate approach such as Aron Grangberg's or just Unity's built in system. I am planning to make an hybrid (navmesh data from Unity , navigation from myself)
Your answer
![](https://koobas.hobune.stream/wayback/20220612192759im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Follow up to AI Pathfinding Question 0 Answers
NPC Fleeing with Unity Pathfinding? 1 Answer
Basic Enemy Javascript 0 Answers
Object Avoidance for my enemies 1 Answer
AI Movement Inside Volume 1 Answer