# Avoid navmesh rebuild lag?

**URL:** <https://forums.unrealengine.com/t/avoid-navmesh-rebuild-lag/391929>\
**Category:** AI\
**Tags:** ai-navigation, rebuild, unreal-engine, navmesh, avoidance, question\
**Created:** [April 26, 2017, 1:14pm UTC](https://forums.unrealengine.com/t/avoid-navmesh-rebuild-lag/391929 "2017-04-26T13:14:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_a888ca73](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a888ca73](https://forums.unrealengine.com/u/anonymous_user_a888ca73)\
**Post date:** [April 26, 2017, 1:33am UTC](https://forums.unrealengine.com/t/avoid-navmesh-rebuild-lag/391929/1 "2017-04-26T01:33:11Z")

</div>

Here’s a video showing the issue. (Of course when I record, it’s not as bad, but it’s still visible at around 1:15ish)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a888ca73](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a888ca73](https://forums.unrealengine.com/u/anonymous_user_a888ca73)\
**Post date:** [April 26, 2017, 1:14pm UTC](https://forums.unrealengine.com/t/avoid-navmesh-rebuild-lag/391929/2 "2017-04-26T13:14:26Z")

</div>

Hey there! This is my first post, so I will try my best to be clear and as little of a pain as possible.

**Alright so the scenario:**

I am creating a turn-based top down game that is **not using a grid**. Everything is going great, except for one problem. During combat, I have the ai turn off their “can ever effect navigation” so that they do not stop themselves from pathing. Upon ending their turn, I have them turn it back on to create an obstacle so that other ai/player can avoid them while moving around. I -would- use something like RVO avoidance, but I need them to **stick to their navpath** which I am finding synchronously and creating a **visual spline** that matches it. The distance traveled along this spline determines action points spent, so therefore they **have** to stick to it.

This all works well and good, until they **turn their navmesh affecting back on**. Not every single time, but often enough it causes a **momentary chug** in the game, dropping sometimes from 120 fps all the way to the teens. This chug lasts typically between a quarter-second all the way up to 2 seconds. (seems random)

**Is there a way that I can continue using the navmesh to help create my spline paths, whilst avoiding this performance hitch that about 75% of the time appears?**

One thought I literally just had was maybe it’s because I’m running the project off an external hard drive, but I kind of doubt that’s the case if most of the time it’s running at at least 60 fps. (usually around double that)
