diff --git a/src/player.cpp b/src/player.cpp index 0575c52..e069331 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -100,6 +100,8 @@ void Player::_on_dir_horizontal(gd::Ref, float value) { void Player::_on_dir_vertical(gd::Ref, float value) { this->input_directions.y = value; this->anim_tree->set_aim_weapon(value <= AIM_INPUT_THRESHOLD); + if(value < AIM_INPUT_THRESHOLD) + this->camera->set_shoulder(true); this->anim_tree->set_is_walking(value > WALK_INPUT_THRESHOLD); } @@ -120,7 +122,7 @@ void Player::_on_run(gd::Ref event, float) { } void Player::_on_switch_shoulder(gd::Ref event, float) { - if(event->is_pressed()) + if(event->is_pressed() && !this->anim_tree->get_aim_weapon()) this->camera->set_shoulder(!this->camera->is_weapon_shoulder()); }