Excluding navigation onto objects


So I have these tall pillars that I want to cut the nav mesh for avoidance. The left one is just a simple Pro builder mesh with a mesh collider and cuts the baked mesh as required, but as you can see it makes a walkable area on its top (and inside it too if you move it after baking). So as I understand it now I should use a Nav Mesh Obstacle now to define areas that you cannot navigate on. But when I add this I get the result on the right hand pillar. It doesn’t have navigation on its top, as I want, but it no longer carves out the baked navmesh as the left one did (I did rebake it).
So how do I carve AND and prevent navigation? I can turn on live carving on the nav mesh obstacle but I don’t want a live system that can delay startup. The point of baking is that I don’t need to do it live. This is just a test level but it could get far more complicated.
Is this just the limits of the current system or am I missing a trick?
And also the nav mesh obstacle carving is limited to a box or cylinder but without it a mesh collider could carve out any shape. How can I carve out an uneven shape that you also cannot navigate over?

Are these pillars intended to be static? If so, you shouldn’t use NavmeshObstacle. That component is for moving objects, and uses a simplified algorithm so agents can avoid it. It’s more suited to a moving character.

I think you should just bake like you did for the left pillar. The fact that it has navigation on top shouldn’t be a problem, because that surface constitutes a different Navmesh that is unreachable for the agents that start on the ground plane.

obraz

If this philar is seperate game object go to Navigation go to object tab and change Navigation Area to not walkable and rebake nav mesh. You must select this game object to set it not walkable.

Thanks, I’m starting to realise that the NavMeshObstacle is the primary cause for problems and have removed them. But the resulting nav mesh is such a mess. I have a box (walls and a ceiling) surrounding the level and that too has navigation over it. Makes it really hard to see the proper navigation paths.

For my editor (2022.3) it doesn’t have that option as I think it has been changed. The way this works has changed I think, and I thought I was supposed to use the obstacle component instead.
image
As you can see here the navigation static flag has been depricated. But to be honest I got the suggestion of using the navmeshobstacle from Gemini so I guess I will have to do some better research on what the real solution is now.
image

Go to
Window → AI → Navigation (Obstacle)
And select object to change his area for walkable.

In navigation tab you can set more layers for navigation by defoult u have 3 walkable not walkable and jump, and I make this screenshot useing unity 2022.3

Oh, good shout! But should I be using a window that is marked as obsolete?!! What’s the new replacement - or isn’t there one???
image

Ah, tried that setting to set the ceiling object to not walkable (and also tried Navigation static) but it still doesn’t bake without it.


image
I guess it really is obsolete as it no longer does anything.

Finally solved the problem. The new system is the NavMeshModifier. This replaces the old object and navigation static flag system in favour of a component on the object. Makes sense actually and now I know about it should make things easy!
https://docs.unity3d.com/Packages/com.unity.ai.navigation@1.1/manual/NavMeshModifier.html


image

1 Like

Nice! Yes, sorry, I was in transit and couldn’t type properly. There is indeed a “new” system that is basically the same workflow, but based on component. Glad you found it and managed to solve your problems!

1 Like