0 votes

I'm building a 3rd gen Pokémon game as a project to learn Godot. As expected, the camera will be following my player, so in my test scene I have it set up as a child of my player. However, because of the grid system, in order to make the player perfectly centered on screen I need to set up a slight offset on the active Camera2D node. Moving the player from screen to screen, I don't want to manually add the offset to the Camera2D node, as well as anything else I may wish to implement to the camera itself. Would it be better to add the camera as a node saved in the player scene itself, or make a unique player camera scene that I just add to every screen? What's the best approach in your experience?

Godot version 4.0
in Engine by (93 points)

1 Answer

+1 vote

You might want to look into remote_transform nodes... they can be used to add an offset.

Also, you can have multiple cameras in the scene, and switch which one is currently active... if your camera follows your player most of the time, I would definitely make at least one of the cameras a child of the player node.

by (1,340 points)

As far as the camera that is a child of my player, would you recommend making it actually a part of the player scene, or would there be any reason that might be back practice?

yes. Not bad practice for any reason that I know of :)

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.