How to get the corners of a Camera2D when Stretch mode expand.

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

How can I find the global position of the corners of my camera, even though it stretches in Expand Aspect mode.

:bust_in_silhouette: Reply From: Jowan-Spooner

Hey usurun,
I think that

var upper_left_corner = $Camera2D.global_position - OS.window_size/2

would be a valid workaround for the upper left corner.

Good luck!

Probably why you got a down vote then was because the var didn’t have the onready before it and it didn’t work so you show have put this:

onready var upper_left_corner = $Camera2D.global_position - OS.window_size/2

Instead of this:

var upper_left_corner = $Camera2D.global_position - OS.window_size/2

Edit: nvm for some reason it’s kind of broken
Another Edit: The x is alright but the y is not

BlockOG | 2020-12-01 17:28