Skip to content

Commit

Permalink
Camera 2D Framed issue #372 (#373)
Browse files Browse the repository at this point in the history
Actualizing _follow_framed_offset when on only one side of the frame.
  • Loading branch information
lafitteque authored Aug 27, 2024
1 parent 3b9101e commit ed3955a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,13 @@ func _follow(delta: float) -> void:
follow_position = glo_pos
else:
follow_position = _target_position_with_offset()
else:
elif _get_framed_side_offset().x != 0 and _get_framed_side_offset().y == 0:
follow_position = target_position
_follow_framed_offset.y = global_position.y - _target_position_with_offset().y
elif _get_framed_side_offset().y != 0 and _get_framed_side_offset().x == 0 :
follow_position = target_position
_follow_framed_offset.x = global_position.x - _target_position_with_offset().x
else :
follow_position = target_position
else:
_follow_framed_offset = global_position - _target_position_with_offset()
Expand Down

0 comments on commit ed3955a

Please sign in to comment.