fix: player behaviour tree marks used inputs as handled
This commit is contained in:
parent
219a105b24
commit
a669fcdaf9
1 changed files with 3 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue