NavigationAgent2D weird behavior when connecting tiles with navigation layer

Godot Version

v4.3.stable.official [77dcf97d8]

Question


My NPC is supposed to burrow through the environment, creating tiles with navigation layer as it goes. This works, but whenever I want to “connect” to tiles that already have the navigation layer, the pathing goes weird, going to “the other side”.

Because I navigate to tiles that don’t have a navigation layer, I have the “target desired distance” set to the tile size.

All of this works, until I am about to connect to another area of tiles with the navigation layer. Pretty new to Godot and a bit stumped by what I, surely, am doing wrong.

Would appreciate any help, thank you.