this is my first time posting a question here so we'll see how this goes.
I've created a scene in Godot which is set up as
Area2D
|
|-AnimatedSprite
|
|-CollisionShape2D
Attached is the following script:
func _input_event(_viewport, event, _shape_idx):
if event is InputEventMouseButton \
and event.button_index == 1 \
and event.is_pressed():
print ("success")
During game setup, the main scene's script creates several instances of this scene at different coordinates. The problem is that clicking on them does not trigger the expected print statement. In my troubleshooting I manually added an instance of the scene in the same spot on the scene tree as the ones created by the script and this instance inexplicably does trigger when I click on it.
Any thoughts? What could I be overlooking?