+1 vote

Following a tutorial from youtube by Eli Cuayong.

The camera view is seen godot editor view with camera2D node at position (0, 0) godot-editor https://imgur.com/0qiLBfN

The camera is meant to be centered at positions (0, 0) but when I start play mode, the screen starts offset to bottom-right play-mode https://imgur.com/uniDm9P

Godot version 3.5 stable
in Engine by (15 points)

What is the anchor mode set at?

Thanks for your reply!

The anchor mode is set to Drag Center

1 Answer

0 votes

Can you copy and paste the .tres file? Thanks.

by (37 points)


[gd_resource type="Environment" load_steps=2 format=2]

[sub_resource type="ProceduralSky" id=1]

background_mode = 2
background_sky = SubResource( 1 )

Sorry I meant the comera2d .tscn.

Oh yeap sure thing.

I don't have a camera2d.tscn in the project.

The project has a world node that contains:
1) PlayerNode
2) Camera2D
3) WallNode (5x)
4) 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:
1) Move the playerNode vertically (falling down usually and UP on 'space' keypress
2) Detect collision with the Walls
3) Reset the Walls that go out of bound
4) 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?

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.

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.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.