- Home /
Navmesh cut holes
Hi, i have problems setting up navmesh on my terrain with some nicely cut holes in it. Basicly i have large terrain and there will be a lot of buildings etc. What i would want to do is just take some big box or cylindrical collider, cover the area with it and cut the hole in the navmesh with it. Unfortunately it proves to be quite difficult with the default settings at least for me. I tried having the obstacles under default layer, unwalkable layer, add navmesh obstacle. None of it worked for me. If i do the unwalkable layer on collider, it will cut hole, but for some reason only on the edge. Its problem for me, because its possible for AI to actualy get in the inner circle and then got locked up in there. So i need the hole to complete and across the entire collider.
Any help greatly appreciated. Thanks Oliver
Answer by insominx · Aug 05, 2014 at 05:15 PM
You can procedurally generate nested geometry to prevent this. I wrote a script for this with boxes that you can see in my answer here. It should be pretty easy to make it work for your cylinder.
It reminds me of this: