class_name KeyboardControl extends Node # Command from keyboard input signal dir_changed(dir: Vector2) func _unhandled_key_input(event: InputEvent) -> void: var new_dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") dir_changed.emit(new_dir)