With 4.3, I migrated over to TileMapLayers. Prior, I had a setup where I was using a NavigationRegion2D over the tilemap (which was in a collision group) to figure out what was navigable.
I also have Area2Ds around the map with collision (also in the collision group that was configured on the NavigationRegion2D).
However, as I have now migrated to 4.3, I was receiving “overlap” errors using this set up. So I have changed to using the TileMapLayer Navigation Layer via painting individual tiles.
In the above setup - how do I mark Area2Ds as not-navigable?
You can see the TileMapLayer in the background (yellow grass).
This Area2D has a CollisionPolygon2D on it, and is assigned to the group “navigation polygon_source_group”. In the NavigationRegion2D setup, the NavigationPolygon source geometry group name would pick this collision up and automatically carve out this from the NavigationRegion.
However, now that I am not using a NavigationRegion2D, this doesn’t work.
So: what is the intended way to carve out Area2Ds from navigation within TileMapLayer navigation? Can we still use NavigationRegion2D? What is the intended workflow here?
Apologies if this is wordy, it’s a lot to explain!
As an addendum, you can obviously do something like this, to surround it with non-navigable tiles, but this seems not ideal (and not the intended workflow):
As another addendum, this is what it looks like when using NavigationRegion2D and assigning BOTH the TileMapLayer and the Area2D to the navigation_polygon_source_group in the NavigationPolygon
This “works” but leads to very odd pathfinding and the following error:
E 0:00:02:0595 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'. If you're certain none of above is the case, change 'navigation/3d/merge_rasterizer_cell_scale' to 0.001.
<C++ Source> modules/navigation/nav_map.cpp:990 @ sync()
This only occurs when adding the TileMapLayer to the navigation_polygon_source_group - so I am clearly misunderstanding some part of the workflow.