Stopping (pausing) the script when cursor reaches the end of the screen

Hi,

I have this simple 2d mouselook script:

Now what I want to do next is stop (or pause rather) it’s execution until the cursor is at least 1px away from the edge of the screen and this should apply to all 4 ends of the screen.

Can anybody help me out? I’m new to UE.

Thank you!

Just get the screen resolution(get viewport size), split it into X and Y, and clamp the Mouse coordinates.

If this is to control a camera or player character, [Get Hit Result Under Cursor By Channel] might better serve the purpose, but this should work if you’re using the Full Screen as game space.