Get location under screen space for objects

I’m building a 2d game and updating my camera system. I need to use the edges of the screen and find their corresponding locations in world space. I need those coordinates for stopping the camera from going through walls. I have a temporary system in place for estimating these locations but its far too complicated and inaccurate.

Something similar to the “Get Hit Results Under Cursor for Objects” node, but for under screen space is what I’m looking for.

I’ve also included a diagram for more clarity. The colored dots are the locations I need. If the camera moves closer and further from the game’s world plane, or if the screen ratio is changed these locations must be updated.

Hopefully I’ve described this well enough. Any help would be greatly appreciated.

Hello there! This is not very complicated thing to calculate Positions. Here is example to calc left point and right point. Up point and down point both can be calculated in same manner, just use Aspect Ratio when calculating offset

1 Like

Thanks so much for the help! :slight_smile: