Camera can be zoomed with the scroll wheel. Position smoothing enabled.

This commit is contained in:
gdz
2025-12-14 00:16:26 +01:00
parent fbc4795e8a
commit 6bfc792cd0
2 changed files with 7 additions and 1 deletions

View File

@@ -15,3 +15,8 @@ func _process(delta: float) -> void:
global_position += Vector2.LEFT * 2
if Input.is_action_pressed("MoveRight"):
global_position += Vector2.RIGHT * 2
if Input.is_action_just_released("ZoomIn"):
$SmartCamera2D.zoom += Vector2.ONE
if Input.is_action_just_released("ZoomOut"):
$SmartCamera2D.zoom -= Vector2.ONE

View File

@@ -9,6 +9,7 @@ script = ExtResource("1_ig7ij")
metadata/_edit_group_ = true
[node name="SmartCamera2D" type="Camera2D" parent="."]
position_smoothing_enabled = true
script = ExtResource("2_du7i2")
target = NodePath("..")
metadata/_custom_type_script = "uid://xrddv2epi3ty"