diff --git a/modules/wave_survival/player_body.cpp b/modules/wave_survival/player_body.cpp index b0953645..f2c766dc 100644 --- a/modules/wave_survival/player_body.cpp +++ b/modules/wave_survival/player_body.cpp @@ -30,9 +30,9 @@ void PlayerBody::on_child_entered(Node *node) { } void PlayerBody::process(double delta) { - GETSETM(this->camera, fov_factor, { - fov_factor = Math::move_toward(fov_factor, target_fov, float(delta)); - }); + float const target_fov{ get_is_running() ? 1.25f : 1.0f }; + fov = Math::move_toward(fov, target_fov, float(delta * 2.0)); + this->camera->set_fov_factor(fov); } void PlayerBody::physics_process(double delta) { diff --git a/modules/wave_survival/player_body.h b/modules/wave_survival/player_body.h index 00d06e0a..84cd30df 100644 --- a/modules/wave_survival/player_body.h +++ b/modules/wave_survival/player_body.h @@ -36,6 +36,7 @@ private: float acceleration{ 40.f }; float jump_strength{ 4.f }; Vector2 movement_input{ 0, 0 }; + float fov{ 1.f }; PlayerCamera *camera{ nullptr }; WeaponInventory *weapons{ nullptr };