system
September 17, 2022, 3:40pm
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
yshen
Following a tutorial from youtube by Eli Cuayong.
The camera view is seen godot editor view with camera2D node at position (0, 0) Imgur: The magic of the Internet
The camera is meant to be centered at positions (0, 0) but when I start play mode, the screen starts offset to bottom-right Imgur: The magic of the Internet
What is the anchor mode set at?
shifitzel | 2022-09-18 19:49
Thanks for your reply!
The anchor mode is set to Drag Center
system
September 19, 2022, 10:52pm
2
Reply From:
shifitzel
Can you copy and paste the .tres file? Thanks.
#default_env .tres
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )
Sorry I meant the comera2d .tscn.
shifitzel | 2022-09-20 10:56
Oh yeap sure thing.
I don’t have a camera2d.tscn in the project.
The project has a world node that contains:
PlayerNode
Camera2D
WallNode (5x)
CanvasLayer
In the World and WallNodes, there is only a _physics_process
function that moves the WallNodes by a Vector2.
In the PlayerNode, there are logic to:
Move the playerNode vertically (falling down usually and UP on ‘space’ keypress
Detect collision with the Walls
Reset the Walls that go out of bound
Display the score via CanvasLayer
As such there is no reference to the Camera2D except being a child of the World node.
Hope this helps, thank you
If you isolate the Camerra2d does it work?
shifitzel | 2022-09-22 01:38
I’m not sure how to isolate the node, would you be able to guide me?
Create a new scene. Copy and paste the Camera2d into the scene. See if the camera is shifted right when you run that new scene.
shifitzel | 2022-09-23 14:30
Yes it seems like the camera is still shifted to the bottom-right. I’ll reply with the links of the editor and playmode view when they are uploaded.
I would suggest playing around with the camera settings and seeing if anything changes.
shifitzel | 2022-09-28 00:54