Detecting collision with single tile in a tilemap

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

Have a tile set with walls and want them to disappear when they collide with certain nodes

i am currently using: on body entered(body) and body.get_name() for specific collisions
but because i am using a tileset it detects the wole tileset instead of the tile type

what i can do?

:bust_in_silhouette: Reply From: Joleeee

Hello FrogKnight. The way I would do it is to get the position of the colliding object. Then I would use the world_to_map function in the tilemap class to convert the position from world space to tilemap space. After that just set the cell with set_cell to -1 to remove it.