+1 vote

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.

asked Apr 5, 2017 in Engine by manuieee (13 points)

1 Answer

+1 vote

Tilemap has many functions you can use to detect and remove the tile http://docs.godotengine.org/en/stable/classes/class_tilemap.html

Look here for how to remove the tile https://godotengine.org/qa/13350/is-it-possible-to-delete-a-single-tile-from-tilemap-from-code?show=13350#q13350

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 :P

answered Apr 6, 2017 by eons (7,764 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.