2d Astar : How to disable a tile from characters?

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


how can I define a tile to be not usable for Astar pathfinding? (For characters not to occupy the same tile.)

I’m trying to implement set_point_disabled(), but since it only accepts integers, I cannot get it to work (with positions Vector2).

I also tried to erase() tiles from the Astar tile array, but that invokes weird behaviour.

Surely there must be an easy way that I haven’t figured out?

Thanks for any input,

:bust_in_silhouette: Reply From: anssiko

For others: the easy way was to use function “point.x + map_size.x * point.y” to transform the Vector2 to an integer.