Get tilemap navigation polygon

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

Given a tile map how do I get the navigation polygon instance of the tiles?

I have a tile map based navigation system and I need to modify the polygon at run time. From what I gathered I need to get the navigation polygon instance, modify it and tell the Navigation2D to use it but I cannot find a way to get the navigation polygon instance from the tile map.

:bust_in_silhouette: Reply From: Jowan-Spooner

Hi J-Camlller,
You can use $TilemapName.tileset.tile_get_navigation_polygon(tile_id). Should do the job.

Good luck!