Navigation mesh not properly working when I use more than one NavigationRegion3D that have almost identical meshes

Godot Version

4.2.1

Question

I’m making a tower defense game and I had to use 3 NavigationRegion3D for each level, one for flying NPCs, one for the ground NPCs including the player, the last one is for the ground again but has slight difference. The original NavMesh works fine but the other version of NavMesh had an issue. Note, I triggered the switch of NavigationRegion for the player when the wall appear as seen on the video. The player is unable to navigate freely on the trench area… Can anyone help me figure out what I’m doing wrong or link me to an answer for reference? I’ve looked around but couldn’t find anything.

  • Video link: TroyFacebook

  • Here’s the error message I’m getting:

E 0:00:11:0099 sync: Navigation map synchronization error. Attempted to merge a navigation mesh polygon edge with another already-merged edge. This is usually caused by crossing edges, overlapping polygons, or a mismatch of the NavigationMesh / NavigationPolygon baked ‘cell_size’ and navigation map ‘cell_size’.

<C++ Source> modules/navigation/nav_map.cpp:862 @ sync()

You can not stack or overlap navigation mesh surfaces on the same navigation map.

The navigation regions are all placed on the same navigation map and merged together and when the surfaces overlap or intersect the result is logical nonsense. A navigation mesh is a two-dimensional surface with convex polygons conveying geometry connection logic, it can not surface overlap or intersect. It would be like a convex physics shape not being convex, things are bound to break that way.

If you need multiple different navigation meshes sharing similar space you need to mvoe them to different navigation maps. You can find that in the different actor types documentation. Support different actor types — Godot Engine (latest) documentation in English

1 Like

I thought so too, thanks for enlightening a bit. The solution turn out to be simple, I just have to use the enable property of NavigationRegion3D and disable one of them when not in use, then it’s easy to switch Nav Meshes that way that overlaps :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.