I'm trying to use Godot 4.0.1 navigation, and I need to connect navigation polygons that are not fully connected. I found videos doing that in Godot 3.5 using a "Navigation2D" node, but it seems there's no such node in Godot 4. So how do I do it?
I can't simply draw better polygons because my map is randomly generated using blocks that have their own navigation polygons. I want to leave gaps because without gaps my enemies get stuck on corners.
Maybe there is a way to edit navigation polygons using code to remove bits around corners and walls?
#How to connect navigation polygons?
5 messages · Page 1 of 1 (latest)
Godot 4 and Godot 3.5+ connect different NavigationRegion2D / NavigationPolygonInstances either by direct edge overlap or by proximity withing the edge connection margin of the navigation map.
Godot Engine documentation
Different NavigationMeshes are automatically merged by the NavigationServer when at least two vertex positions of one edge exactly overlap. To connect over arbitrary distances see Using NavigationL...
the NavigationPolygon by itself is just a resource of data, it does not do anything when it is not used in a region
pr https://github.com/godotengine/godot/pull/70724 will add a 2D navigation mesh baking feature that allows to automate this "gap creation" automatically from your scene nodes or you can provide the data for this baking procedual as well.