Fixed crouch speed bug

This commit is contained in:
Franklin 2023-09-13 12:01:42 -04:00
parent e362d6f9fa
commit 69092e471a
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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
},
);
}