2D Grid-Based Pathfinding

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

Hi,
I’m creating a grid-based 2d rpg similar to Tibia.
I am currently working on the pathfinding algorithm of the enemys using Navigation2D, but since Navigation2Ddoenst support grid based movement it seems not to be the right choice for me.
I also tried the AStar algorithm of godot and it worked all fine but it always takes a while to initialize the AStar node because it iterates through a tilemap and adds the center positions of the tiles to its walkable points. I think the problem is that it uses GDScript, which is very slow and therefore unsuitable.

Can someone help me figure out how to do that?