Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | HalfTough |
I’m writing simple game to learn Godot. In my game player can fire a bullet, when a bullet hits a wall it should destroy it.
I created my own TileMap
, following GodotDocks. One of my “blocks” for building map is Wall
.
My bullet is a RigidBody2D
with Contact Monitor
enabled and Contacts Reported
set to positive number.
I connected body_entered(Object body)
to my function.
My idea was to check if body
is a wall, and if it is, run something like body.destroy()
where destroy()
is my function inside of Wall
.
Problem is, body
seems to be not instance of my Wall
but instead it’s TileMap
.
I’m not sure where to go from there. Is there a way to get exact cell being hit or should I solve this problem differently?