Best way to implement a custom player camera across screens?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By YangTegap

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?

:bust_in_silhouette: Reply From: rossunger

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.

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?

YangTegap | 2022-12-18 22:10

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

rossunger | 2022-12-18 22:17