Don't add more than your own velocity when climbing up

This commit is contained in:
GitGhillie
2025-04-17 17:09:30 +02:00
parent 32473be5bc
commit 25207968ce

View File

@@ -121,8 +121,9 @@ pub fn kinematic_controller_collisions(
// *───────────────────* // *───────────────────*
let max_y_speed = -linear_velocity_xz * slope_angle.tan(); let max_y_speed = -linear_velocity_xz * slope_angle.tan();
// Commenting out this line can help with the crate jumping issue if linear_velocity.y < 0.0 {
linear_velocity.y = linear_velocity.y.max(max_y_speed); linear_velocity.y = linear_velocity.y.max(max_y_speed);
}
} else { } else {
// The character is intersecting an unclimbable object, like a wall. // The character is intersecting an unclimbable object, like a wall.
// We want the character to slide along the surface, similarly to // We want the character to slide along the surface, similarly to