Camera control fixes
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 8s
Create tag and build when new code gets to main / Export (push) Successful in 1m13s

This commit is contained in:
2026-01-31 13:20:16 +01:00
parent f2dcd332f4
commit da655ed9b7
3 changed files with 260 additions and 3 deletions

View File

@@ -14,9 +14,16 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
var limit_left_at_center = limit_left + get_viewport_rect().size.x/2
var limit_right_at_center = limit_right - get_viewport_rect().size.x/2
if position.x < limit_left_at_center:
position.x = limit_left_at_center
if position.x > limit_right_at_center:
position.x = limit_right_at_center
if should_move_right:
position.x += pan_speed
if should_move_left:
if should_move_left and position.x > 0:
position.x -= pan_speed