Strange behavior with locking mouse cursor

Good day,

I’m developing ideas based around moving pawns. I’ve come up against unusual behavior in one blueprint focusing on locking the mouse cursor in position once it reaches within 50 pixels of the outside of the game screen. In begin play I get the current screen resolution, then take away 50 from those values and set that as my max values for x and y. I then use an “inrange” node to control gates then using clamp integers to lock the mouse cursor once the sphere goes outside the game window. It works fine in the x direction, but the y direction when moving downward it pulls the mouse cursor to one side then stops altogether…I’ve attached a screenshot of the blueprint and a video showing the behavior.

Thanks,

Pete