How can I get the current camera world bounds.
I'm facing 2 problems, the first I cant seem to get the current active camera from the game engine, I have to specify the camera node path, get_viewport().get_camera()
returns null
Second I'm using get_viewport_transform().affine_inverse()
to get the global bounds of the camera, but if I resize the window, the coordinates get all mixed up.
I'm tying to implement a screen edge arrow that points to an offscreen node.
I managed to get it working but if for some reason the screen is resized the calculations gets wrong.
Here is the code, create a sprite, attach this code, select 2 nodes. Resize the window to see the problem.