From cdbd2f3d392e5374fd9e5f6d9026089f67d931c5 Mon Sep 17 00:00:00 2001 From: GitGhillie Date: Thu, 17 Apr 2025 16:42:40 +0200 Subject: [PATCH] Limit velocity if climbable --- src/control/collisions.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/control/collisions.rs b/src/control/collisions.rs index 641cc45..b7e5d8c 100644 --- a/src/control/collisions.rs +++ b/src/control/collisions.rs @@ -120,12 +120,9 @@ pub fn kinematic_controller_collisions( // │ * | // *───────────────────* - let _max_y_speed = -linear_velocity_xz * slope_angle.tan(); - - // TODO: figure out why this is needed, without it we - // cannot do these crate to crate jumps anymore which is intented. - - // linear_velocity.y = linear_velocity.y.max(max_y_speed); + 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); } else { // The character is intersecting an unclimbable object, like a wall. // We want the character to slide along the surface, similarly to