Dynamically updating TilemapLayer navigation mesh with obstacles

Godot Version

v4.3.stable.official [77dcf97d8]

Question

I’m making a game that enables the player to place structures (Static Bodies) on top of a TilemapLayer, and there are enemies that should be able to pathfind around those structures.

The idea is that I should be able to “carve” a hole in the navigation mesh whenever I add an obstacle. I have tried using NavigationObstacle2D but from my understading it only affects the baking process of meshes, and doesn’t update meshes that were already baked. Also tried using obstacles directly with the NavigationServer but that was also of no use.
image
(if it helps to make it clear, here’s an image with the path of the agent, the highlighted obstacle and the navigation mesh)
I have been researching and the only solution that I found was to not use the tilemap navigation layers and instead code my own using Navigation Regions, but those were discussions on previous version of Godot.
I would like to know whether it is possible to do that or if I’m overlooking something in the docs.
Any help is appreciated, thanks in advance

I am not familiar with the built in navigation. Ive always used either AStar2d or Astargrid2d for my tilemap navigation.

I find it fairly simple to edit points and add points, at least once you get used to it. Setting it up at the beginning can be the most difficult to figureout adding the points and where to add those in.

AStar2D are set up all in code within your tilemap node, you can feed it the points you want via your tilemap layers. Later have an update func that you call to change if a point is solid or not.