fix: player can't hang from head-height ledges

This commit is contained in:
Sara Gerretsen 2026-05-08 13:54:27 +02:00
parent 146348a294
commit 25eb873e65

View file

@ -202,7 +202,7 @@ func _ready():
%LedgeHangTimer.timeout.connect(set.bind(\"timeout\", false))
func _enter() -> int:
if not timeout and blackboard.hang_ray.is_colliding() and blackboard.hang_ray.get_collision_normal().y > 0.9 and body.is_on_wall():
if not timeout and not body.is_on_floor() and blackboard.hang_ray.is_colliding() and blackboard.hang_ray.get_collision_normal().y > 0.9 and body.is_on_wall():
timeout = true
return Success
else:
@ -230,6 +230,8 @@ func _execute() -> int:
var input_dot_wall : float = wall_normal.dot(blackboard.get_world_move_input())
if diff.length() < 0.05 and input_dot_wall < -0.5:
return Success
if body.is_on_floor():
return Fail
return get_status()
func _exit():