feat: implement player movement controller with grounded state, stair stepping, and wall interaction mechanics

This commit is contained in:
DottsGit
2026-06-10 22:11:00 -04:00
parent def2925a43
commit da4a6442c7
4 changed files with 17 additions and 4 deletions
+3 -1
View File
@@ -123,6 +123,8 @@ func update(delta: float) -> void:
if space_state.intersect_ray(head_ray).is_empty():
# We can safely step up
player.global_position.y += step_height + 0.01
if player.head_pivot and player.head_pivot.has_method("add_step_offset"):
player.head_pivot.add_step_offset(-(step_height + 0.01))
# Push slightly forward to get onto the step
player.global_position += fwd * 0.1
# Restore horizontal velocity that was lost from hitting the wall
@@ -156,7 +158,7 @@ func update(delta: float) -> void:
return
# ── Wall interaction (Run, Climb, Vault) ──────────────────────────────
if machine.input_dir.length() > 0.1 and machine.wall_cooldown_timer <= 0.0 and not machine.input_crouch:
if machine.input_dir.length() > 0.1 and machine.input_dir.y <= 0.0 and machine.wall_cooldown_timer <= 0.0 and not machine.input_crouch:
var fwd_wall = machine.detect_wall_forward()
if fwd_wall.hit:
if fwd_wall.is_short: