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.
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.
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.