From 25207968ce60458ced0cff67eaa99821bcdd2077 Mon Sep 17 00:00:00 2001 From: GitGhillie Date: Thu, 17 Apr 2025 17:09:30 +0200 Subject: [PATCH] Don't add more than your own velocity when climbing up --- src/control/collisions.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/control/collisions.rs b/src/control/collisions.rs index b7e5d8c..2c6fe12 100644 --- a/src/control/collisions.rs +++ b/src/control/collisions.rs @@ -121,8 +121,9 @@ pub fn kinematic_controller_collisions( // *───────────────────* let max_y_speed = -linear_velocity_xz * slope_angle.tan(); - // Commenting out this line can help with the crate jumping issue - linear_velocity.y = linear_velocity.y.max(max_y_speed); + if linear_velocity.y < 0.0 { + linear_velocity.y = linear_velocity.y.max(max_y_speed); + } } else { // The character is intersecting an unclimbable object, like a wall. // We want the character to slide along the surface, similarly to