I am making a blueprint that basically allows click and drag movement of a viewport displaying a 2d widget. The flow of execution goes pretty much like this:
- When right mouse pressed →
- Get mouse delta →
- Amplify mouse delta →
- New Screen Coordinates = Old Screen Coordinates + Mouse Delta →
- Set Position in Viewport as New Screen Coordinates
The script works fine, but the problem is that mouse still moves when holding down right click.
So my question is: Is there a function that freezes the cursor in the Viewport but still allows mouse delta capture?
Bump, if anyone knows how to do this, or if it’s even possible, I have also been struggling with this exact scenario.
There is no function for that
@dopadream - don’t place a question marked as “Answer” as it’s not an answer… This also wanted to make me skip this thread but I was curious about your “answer”
You can make your own function
Add a boolean which will check for RMB, when it’s true 1 time save coordinates then move the mouse back to this place when you’re moving the mouse - you’ll get the mouse movement still calculated and it will automatically go back to the place where you pressed the button
That’s the simplest way of doing it