Returns the tilemap (grid-based) coordinates corresponding to the given local position. To use this with a global position, first determine the local position with Node2D.toLocal:
var local_position = my_tilemap.to_local(global_position) var map_position = my_tilemap.world_to_map(local_position)
See Implementation
Returns the tilemap (grid-based) coordinates corresponding to the given local position. To use this with a global position, first determine the local position with Node2D.toLocal: