- Edited
Hi there,
I have this structure:
Scene: Brick.tscn - Script: Brick.gd Brick: StaticBody2D func _input(event): if (event is InputEventMouseButton) && (event.is_pressed()): print(name) #self.queue_free()
Scene: Level.tscn - Script: - Rows: Node2D -- Row_1: Node2D ---- Brick1 (instance of Brick.tscn) ---- Brick2 (instance of Brick.tscn) -- Row_2: Node2D ---- Brick3 (instance of Brick.tscn) ---- Brick4 (instance of Brick.tscn)
What happens: I have four bricks in two rows. I click on one Brick and get back the name of all instanced bricks.
What I expect: I click on a brick and get back the name of clicked one. Later i want to free the clicked brick.
I do not understand why i get back all bricks. Any Idea on what I'm doing wrong here?
Thanks Antonio
Uses: Godot 3.0.6 / GDScript