-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make get_viewport().get_camera()
able to return a Camera2D node instead of a Camera3D
#2620
Comments
What if the scene has both a 2D and 3D camera active at the same time? While uncommon, this is technically possible. |
null
in 2D sceneget_viewport().get_camera()
able to return a Camera2D node instead of a Camera3D
Questions to myself to answer your question @Calinou:
I tested the 2D case and the last camera in the tree is used as the primary camera for the scene. In general in 2D I'd expect that last camera to be returned and in 3D the same. It seems like In the case of mixed 2D and 3D cameras I guess the Node itself could determine which camera to pull? (I.e spatial pulls 3D cameras and Node2D pulls 2D cameras) |
Maybe |
I think |
Describe the project you are working on
Any project which requires a 2D camera
Describe the problem or limitation you are having in your project
get_viewport().get_camera() returns
null
in 2D sceneThe documentation specifically states that this function returns a Camera3D, however it is strange that in 2D scenes it does not return the Camera2D
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Return Camera2D or Camera3D as a Variant
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Please see above
If this enhancement will not be used often, can it be worked around with a few lines of script?
Not so easily, I could add my cameras to groups and then search for them but it's not ideal.
Is there a reason why this should be core and not an add-on in the asset library?
This seems like a core feature
The text was updated successfully, but these errors were encountered: