feat: adds a cd to the jump to prevent spam jumping up a slope
This commit is contained in:
@@ -98,7 +98,7 @@ func update(delta: float) -> void:
|
||||
vel -= machine.wall_normal * 2.0
|
||||
|
||||
# ── Wall jump ─────────────────────────────────────────────────────────
|
||||
if machine.input_jump_just_pressed:
|
||||
if machine.input_jump_just_pressed and machine.jump_cooldown_timer <= 0.0:
|
||||
# Base jump off velocity on current preserved momentum
|
||||
var jump_vel: Vector3 = _current_tangent * _run_speed
|
||||
|
||||
@@ -114,6 +114,7 @@ func update(delta: float) -> void:
|
||||
machine.wall_side = 0.0
|
||||
machine.wall_cooldown_timer = 0.3
|
||||
machine.register_chain_mechanic("wall_jump")
|
||||
machine.jump_cooldown_timer = params.jump_cooldown
|
||||
machine.switch_to("air")
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user