- Home /
Visibility Polygons for FPS AI to move tactically
Does anyone know how to implement visibility polygons in Unity's AI system? I want to write FPS AI that clears an area by checking all the places that aren't immediately visible, cutting the pie the whole time (military term for going around corners while aiming at corner).
I know you can sorta get NavMesh data by using NavMesh.CalculateTriangulation, and I know that you can use that to get access to the navmesh vertices and from there you can raycast through all vertices to get a visibility polygon.
This is what I'm talking about:
https://en.wikipedia.org/wiki/Visibility_polygon
However, I don't know how to write AI that will go check the unseen areas dynamically. Can anyone help?
I drew a step by step diagram of the behavior I want to simulate in this figma!
https://www.figma.com/file/ekWZTrsn5uhAqV3iL7Q9WalZ/FPS-AI
the frames near the bottom represent some of the ideas I had to tackle this problem.
Your answer
![](https://koobas.hobune.stream/wayback/20220612135021im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Making an FPS arcade game. 0 Answers
Distribute terrain in zones 3 Answers
Making an FPS arcade game. 0 Answers
"Dynamic" static variables 1 Answer
Multiple Cars not working 1 Answer