Viewport X, Y to world location on plane

I’m trying to figure out a way to get the XYZ world location projected from the viewport’s X and Y.

I have a top down camera and I need to restrict my pawn from walking out of the view. This value must scale according to the screen resolution.

Does anyone have a simple solution how to set this up using blueprints? I’m kind of stuck :slight_smile:

Just to clarify it some more:


Let’s say the above is the viewport, looking through a camera pointed towards the ground. I want to be able to get the ‘+’ viewport point 2Vector in the world space (3Vector) at ground level. In my case the ground level is always at 0.0