Skip to content

Fixing NavMesh Issues

First thing I wanted to tackle today was the weird "delay" when generating the NavMesh where the last removed tile would still be accounted for when rebuilding the NavMesh. When looking online for an answer, I ran across this, which corroborated my assumptions. I did try several other possible solutions, though, so it wasn't like I just went looking for something that agreed with me!

Placeholder

I ended up adding a Coroutine that waits until the end of the current frame/update cycle to rebuild the NavMesh. This allows the old tile game object to be cleaned up before rebuilding the NavMesh. Everything seems to be working as expected now.

Here is the original behavior: Placeholder

And the corrected behavior Placeholder