fix tiny weirdness of ladder

This commit is contained in:
Haze Weathers 2023-05-24 18:03:26 -04:00
parent 18f1eca8ed
commit 2caa329418
3 changed files with 5 additions and 2 deletions

View file

@ -191,7 +191,7 @@ func _on_Climbing_state_entered() -> void:
snap = Vector2.ZERO
var input_dir = sign(Input.get_axis("ui_left", "ui_right"))
var ladder_dir = sign(_attached_ladder.middle - global_position.x)
var flip = global_position.y - 1.0 <= _attached_ladder.global_position.y and input_dir == ladder_dir
var flip = global_position.y - 1.0 <= _attached_ladder.global_position.y and input_dir == ladder_dir and is_on_floor()
print(ladder_dir)
print(flip)
if ladder_dir >= 0.0 != flip:

View file

@ -1165,8 +1165,8 @@ script = ExtResource( 8 )
[connection signal="state_physics_processing" from="StateChart/Root/Movement" to="." method="_process_movement"]
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded" to="." method="_on_Grounded_state_entered"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded" to="." method="_process_grounded"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_horizontal_movement_grounded"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_can_walk"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_horizontal_movement_grounded"]
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Still" to="." method="_on_Still_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Walking" to="." method="_on_Walking_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Blinking" to="." method="_on_Blinking_state_entered"]