Set Mouse Position Not Working Correctly?

Hi All

I might be wrong, but I think that the SetMousePosition node is working incorrectly, either that or I am misunderstanding something.

Gives the following result on firing the event:

324260-ue4editor-l4f8py5cdu.png

Unless I am missing something shouldn’t these be the same value?

If you read the tooltip of the SetMousePosition node, you’ll notice that it’s using pixel screen space rather than viewport size (which can be scaled, for example).

Now imagine having 3 monitors where the screen space is ~6000px…, while the game window viewport sports a measly 1280px.

You’re reading viewport but setting screen coords. If you were to run things fullscreen on a single screen, these should be identical providing no DPI scaling is taking place. Otherwise, you’ll need to translate the coordinates from one space to another.

Thank you for your help

My question then becomes do you know a good way to convert from viewport space to screen space? I can find methods to convert from screen space to viewport, but none the other way around unless I am missing them.

Could you briefly describe what this is going to be used for? Perhaps there is a neat method of achieving it without going through the hassle.

So basically there is a 2d black filter on the screen with a spotlight shining through it to see the game world, this spotlight is usually automatically controlled but I want the user to also be able to take control of it with their mouse. As the spotlight isn’t always in the same place I would ideally want, when the user decides to take control, the mouse to be set to the spotlights position so it doesn’t teleport to a random point on the screen.