- Edited
thanks, after looking into different Node's and there signals I noticed that the Control node also has the gui_input signal so I just used that one and it works fine.
I also added a player scene with following code:
extends CharacterBody2D
func _on_input_event(viewport, event, shape_idx):
if event.is_action_pressed("left_click"):
print("Tank clicked")
It works fine but when I instance the player scene in my main scene it doesn't print anymore which means the function is not called in my main scene.