From 846f327a22b9ec1bea5062b1ad577ae48975225b Mon Sep 17 00:00:00 2001 From: blujai831 Date: Tue, 1 Apr 2025 12:25:25 -0700 Subject: [PATCH] Prevent unrealistic climbing by modulating ground acceleration by ground plane horizontality --- characters/base/character.gd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/characters/base/character.gd b/characters/base/character.gd index 923aff1..5541a7c 100644 --- a/characters/base/character.gd +++ b/characters/base/character.gd @@ -611,7 +611,13 @@ func _do_standard_motion(delta: float) -> void: ) # Then, check which forward acceleration value to use. var max_accel: float = ( - _air_acceleration if use_air_physics else _ground_acceleration + _air_acceleration if use_air_physics else ( + # If we're using ground acceleration, + # modulate it by the horizontality of the ground plane. + # This helps prevent unrealistic climbing. + _ground_acceleration * + abs(ground_normal.dot(Vector3.UP)) + ) ) # Then, calculate true forward acceleration as follows: # from standing at rest,