When calculating paths on a tilemap, Navigation2D only uses the provided Polygons as indicators, and not as hard constraints on where the path can be. When trying to use a Tilemap with more complex tiles, this can lead to characters phasing though walls, because Navigation2D simply ignores that the navigation polygon dictates that a region is inaccessible.
Here is a basic example:
This Screenshot is the navigation Polygon for a tile. For humans looking at it, a character that wants to get from the top to the bottom would need to follow the specified zig-zag path. Godot however will determine, that the polygon provides some connection between the top and the bottom, therefore the resulting path is a straight line from top to bottom, ignoring the zig-zag pattern. Now my question is:
How can I make sure that Godot will respect the specified polygon?
The only solution I came up with is to divide each Tile into n*n smaller tiles, which each have their own polygon. That would include large refactorings to my map generation (instead of single tiles being placed, n*n tiles must be placed (in correct config), which also has performance implications).
Ideally, I would like the resulting paths to respect the polygons (I know this has performance implications, but caching would solve most of them).