How can create tiles that can be destroyed ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By manuieee
:warning: Old Version Published before Godot 3 was released.

I am creating a space shooter game and I want to add tiles that can be destroyed by firing laser from the spaceship. Can anyone tell me how can I create tiles that can be destroyed by firing laser on it ?
Thanks.

:bust_in_silhouette: Reply From: eons

Tilemap has many functions you can use to detect and remove the tile TileMap — Godot Engine (stable) documentation in English

Look here for how to remove the tile is it possible to delete a single tile from a tilemap from code ? - Archive - Godot Forum

Use world_to_map with the collision position to to get the cell position of the hit (you may need to translate the hit point a bit on hit direction to get the correct cell).

The laser part depends on how you want to do it :stuck_out_tongue: