I am new to Godot and trying to implement dynamic pathfinding on a 2D map which includes both static obstacles and moving units. As I understand it, Godot's NavMesh makes it almost trivial to generate a path through a pre-baked polygon map , as with the solid-line path in the below image. However, I want my game to be able to re-plan the path if an enemy (or other obstacle) moves to obstruct it--as with the dotted-line path in the image. Is this possible with built-in Godot functionality? And if so, how?
Alternatively, how would you recommend implementing a custom pathfinding script in Godot? I am comfortable with vanilla A* and I plan to learn GDScript and/or C#, but in my experience (in Python/Pygame), grid-based A* is much too slow to re-check the path every frame.