Add ability to center editor camera on scenes when running current scene #8970
Replies: 3 comments 4 replies
-
Changing this default behavior would break compatibility with existing projects that don't use a Camera2D, such as GUI-only applications. Consider using the editor camera replication feature that is available when running a project (click the camera icon at the top of the 2D/3D editor viewport). |
Beta Was this translation helpful? Give feedback.
-
But could it not just be an option that was available in the project settings? Like a viewport camera anchor that defaults to top left but can be changed to center if wanted. That way it wouldn't break any compatibility. I didn't know about the editor camera replication feature though so thanks for that suggestion! It is very cool but it still has the same issue of not being able to be defaulted to on. It might not seem like the biggest deal in the world but from a useability standpoint, the ability to center the editor camera on the origin by default just seems like such a fundamental feature for a game focused engine. Not trying to be difficult, just wondering if there's any genuine reason why this can't/shouldn't be allowed as a simple project setting? |
Beta Was this translation helpful? Give feedback.
-
I have been affected by the default behavior many times, and I've seen newcomers frustated by it too. I think the problem is with scenes that are meant to be instantiated from other scenes, so (as @alexgamadev said) they are built around the center of coordinates. So if you want to test the scene in isolation it will show only a quarter (the bottom-right) of the scene. Having (0, 0) as the top-left corner is what you want for main scenes (if they don't have a camera). Now, I think that the Project Camera Override tool is usually what the user expects: to run the scene more-or-less how it looks in the editor viewport. The problem is that it has to be turned on every time, going back to the editor. Besides, this tool deserves more documentation. So what I would like is to turn the camera override on by default if the scene a) is not the main scene b) doesn't have a camera already and c) is not a Control scene. I have created a plugin that does this as a proof of concept: https://github.com/manuq/godot_addon_play_centered I think #7213 is related, because it will be more noticeable running the scene in place of the editor viewport. A newcomer would expect to see things as in the viewport if no camera is set. |
Beta Was this translation helpful? Give feedback.
-
Sorry if this has been mentioned before but I didn't see anything here.
When running a scene, objects tend to be centered on the origin (0, 0) and in a lot of cases the scenes don't have cameras because they don't need them. The problem is that when the scene runs, the camera isn't centered on 0,0 meaning the nodes within the scene show at the top left of the screen, sometimes partially obscured. If the scene is being built around 0,0, it doesn't really make much sense for the camera to be positioned with the top left at 0,0 because you don't normally build scenes only down and to the right. It is possible to get around this in some slightly hacky ways as far as I'm aware (Like autloading a centered camera) but really this should be a simple inbuilt change since it's so fundamental.
Correct me if I'm wrong but a centered viewport camera would be significantly more useful to the majority of users than the current top-left anchored one but maybe there's some common use case I'm missing.
Beta Was this translation helpful? Give feedback.
All reactions