fix: initially wrong wall touch direction when wallsliding

This commit is contained in:
Jakob Feldmann 2023-09-25 19:53:49 +02:00
parent 5c988c51aa
commit 09da6e9f3e

View File

@ -211,11 +211,12 @@ func is_touching_wall_completely() -> bool:
# Attached to wall state is in the PlayerStateMachine
func is_correct_walljump_input(direction: Vector2) -> bool:
return (
Input.is_action_pressed("jump")
&& abs(direction.x + wall_touch_direction) < 1
&& abs(direction.x + wall_touch_direction) >= 0
)
if is_touching_wall_completely():
return( Input.is_action_pressed("jump")
&& abs(direction.x + wall_touch_direction) < 1
&& abs(direction.x + wall_touch_direction) >= 0
)
return false
func is_correct_airstrafe_input() -> bool: