- Home /
Why does my navmesh not stop at this wall? (stealth tutorial)
so i'm doing the stealth tutorial, onto chapter 4 now, i've just baked my very first navmesh.
The tutorial specifically mentions to set the bake height of the navmesh to at least 1, and it specifically mentions the reason for this is to ensure that the navmesh doesn't try to go under the Battle Bus in the centre of the map.
Well here it is:
my navmesh going straight under the battlebus. I did exactly as suggested. Moreover, i've tried increasing the height to 2 and that didn't solve anything
The battle bus itself does not have any colliders, and i suspected that as the issue, however a little quick testing indicates otherwise. As can be seen in the image, there's an invisible wall which runs around it, which is part of env_stealth_static.
In fact, there are hundreds of walls just like it all over the scene, and the navmesh is not respecting any of them, as shown here:
It stops at objects, but not at the invisible boundary walls which are the actual colliders, and which determine where actors can go. If i try to run AIs through this it's just going to be a horrible mess, surely.
What's going on here? how can i fix it?
$$anonymous$$y battlebus wasn't marked as static, i did that and it fixed that particular problem. but the issue of navmesh not respecting these boundary walls still stands
When I used nav mesh before, I had this type of issues when the colliders on the ground where not actually touching the wall colliders, not sure if this is your case.
there ARE no wall colliders. This green invisible wall stuff runs over every surface in the level.
The individual walls, barrels, etc, have no collision shapes of their own. Everything is governed by this one massive mesh collider attached to their parent object.
the navmesh seems to be respecting renderers, and not colliders.
How about marking the barrels as obstacles, this might fix your problem.
Answer by FairGamesProductions · Nov 08, 2014 at 01:18 AM
You are completely right. The NavMesh follows the mesh not the colliders. But this is your SALVATION!
If you create a new mesh from the meshcollider you are using, and THEN bake the NavMesh it should bake correctly! Then you can just disable the renderer and leave the Mesh Collider.
That should solve your problem. Just make sure that you mark the mesh as static.
Your answer
Follow this Question
Related Questions
Navmesh carving and agent avoidence. 0 Answers
Randomize NavMeshAgents path finding with same destination 1 Answer
Unity Crashes when decompressing Stealth assets 3 Answers
Question on Unity Project: Stealth - Chapter 1 - Video 2 at the beginning 2 Answers
enable/disable navmesh agent and obstacle same object (player) 0 Answers