feat: adds a cd to the jump to prevent spam jumping up a slope
This commit is contained in:
@@ -48,12 +48,14 @@ func update(delta: float) -> void:
|
||||
return
|
||||
|
||||
# ── Jump off wall ─────────────────────────────────────────────────────
|
||||
if machine.input_jump_just_pressed:
|
||||
if machine.input_jump_just_pressed and machine.jump_cooldown_timer <= 0.0:
|
||||
var push_dir := machine.wall_normal * params.wall_run_jump_off_normal
|
||||
player.velocity = Vector3(push_dir.x, params.jump_velocity, push_dir.z)
|
||||
machine.wall_normal = Vector3.ZERO
|
||||
machine.wall_side = 0.0
|
||||
machine.wall_cooldown_timer = 0.3
|
||||
machine.register_chain_mechanic("wall_cling_jump")
|
||||
machine.jump_cooldown_timer = params.jump_cooldown
|
||||
machine.switch_to("air")
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user