Center the default viewport

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

Situation: We have the scene of an object such as a spaceship, with the root node at 0.0.

Problem: When playing the scene, to test, the default viewport will make the ship appear in the upper left corner.

Question: Can we make the default viewport centered at 0.0?

:bust_in_silhouette: Reply From: luislodosm

I found a solution:

  • Create a scene with a Camera2D node centered at 0.0 with Current enabled.
  • Add the camera scene to Project Setting > AutoLoad.

I was expecting something more simple, anyway thank you!

thiagola92 | 2023-02-23 20:42

This isn’t a solution, it’s a hack. It’s adding a new Camera2D node every time you load a scene. We should have an option to actually move the default viewport to be centered on (0, 0) rather than (0, 0) being the top left. I understand that we can’t change that to be Godot’s default since many previous projects are programmed with (0, 0) being the top left, but we could definitely add a couple variable to the project settings that let you change the default viewport’s location across the whole project. Any chance that someone with more experience developing godot can help make this happen?