Hello!! I have an area, parented to an animatedsprite2d, parented to a staticbody2d (although im not sure if that matters but its better to be safe than sorry). I wanted to make this sprite clickable, so i put this into the child area2d’s script:
func _on_area_2d_mouse_entered() -> void:
print("mouse_entered")
if Input.is_action_just_pressed("clicked"):
print("mouse_clicked")
THe mouse_clicked is in my input map, and when my mouse entered, it is printing. It just isnt saying i clicked it. How do i make it clickable, like a button? DO i have to make it a button?
You only check if clicking while entering. Not at other times. You need it in a separately called part of the code. Right now you have to enter and be clicking at the same frame fir it to work.