InputEventMouseButton registered 2 clicks ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ExiledBeast
func _on_Area2D_input_event(viewport, event, shape_idx):

if event is InputEventMouseButton:
	hunger.value += 50
	print("1 click")


This is my function for the mouse click. When I click the object, the hunger.value suppose to increase to 50. Currently, when I click, the value increase to 100 because it detects as double click. Is there something I’m missing here ? Hope someone can help me with this.


:bust_in_silhouette: Reply From: hilfazer

Do this:

if event is InputEventMouseButton and event.pressed:

Thank you for your help. It’s working and registered 1 click.

ExiledBeast | 2018-03-09 03:31

It works fine, thanks.

By the way, if InputEventMouseButton detects a double click and if one of them is “event.pressed” : what is the other one ?

_chrisot | 2020-05-12 00:32