How do I check if a mouse is clicking on a sprite

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By EK1318

I put this code in for my Area2D node:

func _input_event(_viewport, event, _shape_idx):
if event is InputEventMouseButton:
if event.button_index == BUTTON_LEFT and event.pressed:

But, it didn’t work. NOTHING WAS PRINTED OUT!

:bust_in_silhouette: Reply From: EK1318

Nevermind, I didn’t look at the log; it works. sorry!