How would I get nav mesh tighter to object?

Hi there!

I have tried searching for this, but couldn’t find any good answers so I will try here.

For my Spring Into Action-game jam I want to be able to place small obstacles that forces the AI to take another route. It works, but I am having trouble getting the navigation mesh to get as close as possible to the collision sphere of my objects (the collision sphere is set as dynamic object).
No matter what settings I try, it won’t get any closer than this (attached image)

What would I need to do to get it tighter?

Thank you!

(Sorry if this is in the wrong section, though this made the most sense)


It looks like you need to reduce the size of the agent radius in your navmesh, which governs the radius of the smallest agent to traverse it. Making it smaller should tighten the obstacle bounds. You’ll find the option in the project settings under Navigation Mesh > Generation.

My agent radius is at 0, can’t make it any smaller :slight_smile:

Ok, are you doing anything with the actors in the screenshot that could be affecting navigation, like a collision trigger component that has its Area Class set to NavArea_Obstacle or NavArea_Null?

Yes I do, is that the wrong way to do it?

That’s probably what’s causing the issue then: nav mesh generation is treating the trigger like a giant obstacle to navigate around and massively over-compensating. Since you only want AI to avoid the object and not the trigger you might want to just set the trigger to be ignored by navigation, so only the physical object it’s attached to is the thing punching a hole in the mesh. Unless there’s some specific reason why you can’t.

Tried that now, I have removed the collision sphere and instead I am trying with just a static mesh. Still looks the same. And it feels like no matter what settings I have for the nav mesh, it still looks the same. Which feels really weird. Will try a clean project and see if there is a difference.

This might be a tiny thread necro, but I was looking for answers to this very question and found none. However, here’s what fixed it for me:

If you have RecastNavMesh object in your scene, it overrides your Project settings. So you’ll have to adjust the agent radius from there instead of the project settings (though optimally adjust it in both)! :slight_smile:


Thank you! I think I found some kind of solution, but can’t really remember what I did :slight_smile: It was for a game jam, so everything was chaos.
Good to have your answer in this thread if someone has the same problem.

Holy cow, I love you!

There’s probally a Recast Nav Mesh in the world, so most changes you do on Navigation>Generation, means nothing.