How to use Navigation2DServer for pathfinding on 3.5?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ergo

Hello,
I’m trying to make pathfinding for an enemy. When trying to use a Navigation2D node on version 3.5, I got a warning saying it is now deprecated. I know I can still use it for now, but I’d rather try a different method, as it might be more convenient with my current project set up.
The documentation suggests I use Navigation2DServer.map_get_path instead. That seems to require me to manually set up the maps and regions, but I can’t get it to work or find any tutorials on it.
Is there a way to use it with tilemaps like I would with the Navigation2D node? If so, how should I go about it? Am I just approaching this the wrong way?
*I know I can use AStar2D but I don’t want the enemy to be stuck to a grid. I am considering using it instead if I can’t get anything else to work.

:bust_in_silhouette: Reply From: ergo

Not too long after I posted the question, some tutorials popped up.
If anyone stumbles upon this, you can use NavigationAgent2D nodes instead of directly accessing the Navigation2DServer. It needs a NavigationPolygonInstance to define its navigation area.
Here is the youtube tutorial that helped me.