Godot Version
4.2.1 Stable
I’m getting some small bugs with the input system i implemented and i think it all stems from me not understanding the Input system well at all, i have realized through that i can use mouse_filter
to ignore to skip inputs, and some other things but i cannot understand how _input
should be handled in my case.
I have a player that can click to move, as well as an inventory in which items can be clicked, this works fine, however, on i indroduced the ability to hold CTRL + click to move the items quickly, the player just ignores the UI and starts walking towards where i clicked.
I tried doing it the following ways:
This is the inventory slot right now:
func _on_gui_input(event):
# Drag, drop or identify
if event is InputEventMouseButton and event.pressed:
if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT):
This is the player movement:
func _unhandled_input(_event):
if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT):
I have tried using Input.is_action_pressed
and event.is_action_pressed
as well as _Input(event)
to no avail, can someone explain to me how i can make sure the UI clicks and other key presses, etc DO NOT go through and make the player move or fire a skill, i really need to understand this before adding more UI or it will be a mess.