![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | sygi |
I have a very simple 2D scene with a single sprite. I would like to be able to change the default camera. I added a Camera2D, moved it and selected as “current”. In the main view, I can see the boundaries of the camera to change. However, when I run, the original camera (starting at 0, 0) is used.
I tried changing the camera settings and making the camera a child of different nodes, but nothing seems to help.
The scene in question:
[gd_scene load_steps=3 format=2]
[ext_resource path="res://KinematicBody2D.gd" type="Script" id=1]
[ext_resource path="res://icon.png" type="Texture" id=2]
[node name="Node2D" type="Node2D"]
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="KinematicBody2D" type="KinematicBody2D" parent="CanvasLayer"]
position = Vector2( 119.503, 146.059 )
script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="CanvasLayer/KinematicBody2D"]
show_behind_parent = true
position = Vector2( -2.5932, -9.77798 )
scale = Vector2( 1.22236, 1.40821 )
texture = ExtResource( 2 )
[node name="Camera2D" type="Camera2D" parent="CanvasLayer/KinematicBody2D"]
position = Vector2( -278.128, 117.191 )
current = true