add better checks for mouse buttons

This commit is contained in:
2024-10-06 02:53:04 +10:00
parent 506e5e4337
commit cb889e9053
3 changed files with 18 additions and 9 deletions

View File

@@ -27,7 +27,10 @@ func _physics_process(_delta: float) -> void:
func _input(event: InputEvent) -> void:
if event is InputEventMouseButton and selected:
var button_event := event as InputEventMouseButton
if button_event.pressed:
if (
button_event.button_index == MOUSE_BUTTON_LEFT
and button_event.pressed
):
_set_target_click(button_event.position)