landing. don't bounce!

This commit is contained in:
2026-08-27 08:30:03 +03:00
parent 9123574947
commit 02f3e283de
+6 -4
View File
@@ -1041,11 +1041,13 @@ func _physics_process(delta: float) -> void:
velocity.z = flat_n.z * exit_spd velocity.z = flat_n.z * exit_spd
pre_wall_vel = Vector3(velocity.x, 0.0, velocity.z) pre_wall_vel = Vector3(velocity.x, 0.0, velocity.z)
# ── Bounce on landing ───────────────────────────────────────────────────── # ── Landing. Don't bounce ─────────────────────────────────────────────────────
if is_on_floor() and not _was_on_floor: if is_on_floor() and not _was_on_floor:
var impact := -_pre_slide_vel_y velocity.y = 0.0
if impact > DP.f("bounce_min_impact") and not _slam_pending: #Bouncing landing below
velocity.y = impact * DP.f("bounce_restitution") #var impact := -_pre_slide_vel_y
#if impact > DP.f("bounce_min_impact") and not _slam_pending:
#velocity.y = impact * DP.f("bounce_restitution")
# ── Slam landing ────────────────────────────────────────────────────────── # ── Slam landing ──────────────────────────────────────────────────────────
if _slam_pending and is_on_floor() and not _was_on_floor: if _slam_pending and is_on_floor() and not _was_on_floor: