fix: player behaviour tree marks used inputs as handled

This commit is contained in:
Sara Gerretsen 2026-04-26 23:42:57 +02:00
parent 219a105b24
commit a669fcdaf9

View file

@ -32,9 +32,10 @@ void PlayerBehaviourTree::_notification(int what) {
void PlayerBehaviourTree::unhandled_input(Ref<InputEvent> const &event) {
if (event->is_action("move_left") || event->is_action("move_right")) {
this->move_input.x = Input::get_singleton()->get_axis("move_left", "move_right");
}
if (event->is_action("move_forward") || event->is_action("move_backward")) {
get_viewport()->set_input_as_handled();
} else if (event->is_action("move_forward") || event->is_action("move_backward")) {
this->move_input.y = Input::get_singleton()->get_axis("move_backward", "move_forward");
get_viewport()->set_input_as_handled();
}
}