Move position of A* (astar) points

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

I have a TileMap and an A* connected to it. When I change the position of my TileMap my tiles visually move, but my A* does not so I can move to a “tile” where there is nothing visually.

Is it possible to move my A* points, just as I move the position of my TileMap?

I ended up moving my Node2D scene, and then moving my tilemap in reverse direction.

edgyneer | 2023-06-09 11:37

:bust_in_silhouette: Reply From: jgodfrey

I have not used Godot’s A-Star implementation, but looking at the docs I see that it has a set_point_position(int id, Vector3 position) method. I’m not sure if there’s a better way or not, but it would seem that you could iterate through the points and apply the same delta to them as you’ve applied to your tilemap, maybe?