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!

the way you setup is pretty interesting, but your intended control is not clear in description.
do you want to have:
A. RTS like scroll when cursor touched the screen edge.
B. really old school mouse driven scroll window where when the window touched the map edge the scroll should stop.
C. anything special that you wanted to do?

Interesting, really? I’m a noob who doesn’t know what he’s doing tbh. :slight_smile:

Basically, when I move the cursor the camera moves with it as well. As soon as the cursor will reach the any edge of the screen the camera should not move anymore. When the cursor is not at the edge of the screen, the camera continues to move.

then, if this is in a PlayerController blueprint, you can get screen resolution from HUD, you can use getMousePosition to get where your cursor is.

Yeah, that’s what I thought too - I just don’t know how to actually do it :frowning: Blueprints are confusing to me right now. I guess I’ll need some kind of an if statement and something that will stop the execution on command. Could you possibly help me to figure it out? Thanks!

there are plenty in the sticky thread’s tutorials on control flow or if nodes.
go through those and you will be good.