From 69092e471a599cac3552fae79808eeed2506965f Mon Sep 17 00:00:00 2001 From: Franklin Date: Wed, 13 Sep 2023 12:01:42 -0400 Subject: [PATCH] Fixed crouch speed bug --- Readme.md | 1 + src/logic/core/player/player_movement.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Readme.md b/Readme.md index 45e597a..55c6e0e 100644 --- a/Readme.md +++ b/Readme.md @@ -3,6 +3,7 @@ - [x] Skybox - [x] ~~Glitch: Fall does not remove linear damping, only after jump~~ - [x] ~~Glitch: Negative linear damping on jump allows for bunny hopping~~ +- [x] Bug: Crouch speed not being applied - [x] Feature: Add smooth camera movement to camera on crouch. Right now it's too fast and looks arcade af. - [ ] Feature: Add jump effect to camera diff --git a/src/logic/core/player/player_movement.rs b/src/logic/core/player/player_movement.rs index ce2778d..70309ec 100644 --- a/src/logic/core/player/player_movement.rs +++ b/src/logic/core/player/player_movement.rs @@ -145,7 +145,7 @@ pub fn move_player( forward, player_velocity.linvel, time.delta_seconds(), - sprint_multiplier, + sprint_multiplier * crouch_multiplier, ); } if player_movement_input.back { @@ -156,7 +156,7 @@ pub fn move_player( -forward, player_velocity.linvel, time.delta_seconds(), - 1.0, + crouch_multiplier, ); } if player_movement_input.right { @@ -168,9 +168,9 @@ pub fn move_player( player_velocity.linvel, time.delta_seconds(), if player_linear_xz_state.is_sprinting() { - PLAYER_LATERAL_ACCELERATION_WHILE_SPRINTING_MULTIPLIER + PLAYER_LATERAL_ACCELERATION_WHILE_SPRINTING_MULTIPLIER * crouch_multiplier } else { - PLAYER_LATERAL_ACCELERATION_MULTIPLIER + PLAYER_LATERAL_ACCELERATION_MULTIPLIER * crouch_multiplier }, ); } @@ -183,9 +183,9 @@ pub fn move_player( player_velocity.linvel, time.delta_seconds(), if player_linear_xz_state.is_sprinting() { - PLAYER_LATERAL_ACCELERATION_WHILE_SPRINTING_MULTIPLIER + PLAYER_LATERAL_ACCELERATION_WHILE_SPRINTING_MULTIPLIER * crouch_multiplier } else { - PLAYER_LATERAL_ACCELERATION_MULTIPLIER + PLAYER_LATERAL_ACCELERATION_MULTIPLIER * crouch_multiplier }, ); }