- Home /
NavMesh Agent causing huge lag
I tried to find what was causing lags and eventually I found that it was navmesh agent. I did try to look into rendering objects, but all is cubes (with specular material) and a plane, the player and enemy have script. When I start the game it is fine, when reached near enemy the fps drops as low as 3 frames. I remove navmesh component at runtime, fps is back on 100+ frames.
For rendering I used occlusion culling, but it did not make any better, as I am quite sure that navmesh is causing issue.
Tris: 2.1k, Verts:5.7k, FPS: 3.1 (318ms) is what stats show. There is no OnGui() function. I am changing the navmesh destination to player when it comes closer to enemy (in enemy script), if this can cause any computation issue?.
Player and Enemy are both cubes. There are walls (also cubes) and these cubes are baked on plane for navigation. Any solutions?
Your answer
![](https://koobas.hobune.stream/wayback/20220611234515im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Modify NavMeshPath for Tactical FPS (slicing the pie/sweeping maneuver) 0 Answers
How do I get a navmesh agent to stop at the edge of a collider? 0 Answers
Helicopter demo, unity web player and navmeshagent glichy 0 Answers
How to let a navMeshAgent detect if path is blocked by an obstacle? 1 Answer
Navigation Agent "Clipping" (Going inside) Navmesh Deadzone?... 1 Answer