- Home /
Unity build in AI, path selection
I am doing some research about AI for my game. I am very new to AI programming, would greatly appreciate any feedback
When using Unity build in Nav Mesh and pathfinding solution, will I be able to filter/select custom path? I do not always want the shortest path to destination.
For example, if enemy AI is moving to a new location, it must select a path that is safest, concealed from line of fire. Shortest path will not work in this case.
I could roll out my custom AI solution but before I reinvent the wheel, I would like to know if there is anyway I can do "selected path" evaluation with Unity's build in AI pathfinding solution.
P.S I know there is a ton of AI solution in asset store, but this is a partial learning project, so I will not be buying any plug in solutions
Answer by MUGIK · Jul 12, 2016 at 11:48 AM
Yes, u can use custom path: https://docs.unity3d.com/ScriptReference/NavMeshAgent.SetPath.html . Also u can get NavMesh path and use it for calculation ur own path: https://docs.unity3d.com/ScriptReference/NavMeshAgent-path.html . For u the best solution is https://docs.unity3d.com/ScriptReference/NavMeshAgent.CalculatePath.html
Your answer
Follow this Question
Related Questions
Navmesh Trouble 1 Answer
Need help detecting barriers for my game 0 Answers
Setting An AI Routine 2 Answers
Rotating the a NavMeshAgent when going up- or downhill? 1 Answer
How to make a enemy dodge/sidestep? 1 Answer