diff --git a/objects/player/player_scholar.gd b/objects/player/player_scholar.gd index 1a178e5..3ad1301 100644 --- a/objects/player/player_scholar.gd +++ b/objects/player/player_scholar.gd @@ -258,7 +258,7 @@ func _process_pushing(delta: float) -> void: func _process_climbing(delta: float) -> void: # climbing movement var input_dir = sign(Input.get_axis("ui_up", "ui_down")) - velocity.y = input_dir * climb_speed # move in input direction + move_and_slide(Vector2(0.0, input_dir * climb_speed), Vector2.UP) # move animation_player.playback_speed = abs(input_dir) # play/pause animation # play sound @@ -284,6 +284,7 @@ func _process_climbing(delta: float) -> void: # graphics.scale.x = 1.0 # check if still on ladder + ladder_detector.force_raycast_update() if ladder_detector.get_collider() != _attached_ladder: if input_dir == -1.0: state_chart.send_event("ladder_jump") diff --git a/objects/player/player_scholar.tscn b/objects/player/player_scholar.tscn index 64740b0..158d475 100644 --- a/objects/player/player_scholar.tscn +++ b/objects/player/player_scholar.tscn @@ -839,9 +839,9 @@ shape = SubResource( 16 ) [node name="LadderDetector" type="RayCast2D" parent="."] unique_name_in_owner = true -position = Vector2( 0.5, 0 ) +position = Vector2( 0.5, -0.5 ) enabled = true -cast_to = Vector2( 0, -10 ) +cast_to = Vector2( 0, -9.5 ) collision_mask = 64 collide_with_areas = true collide_with_bodies = false