GetMousePosition returns position with a slight offset

If I draw a 2d debug line on the screen from my mouse position, as returned from the player controller, it is always offset from the actual mouse pointer - same Y coordinate, but some discrepancy on the X axis. This offset is constant as far as I can tell - I can hack around it but…

…has anyone else encountered this?

Sometimes its a big offset, seems to tend to be consistent for a while, then change. Doesn’t effect clicking on objects just my 2d code, so my guess is something I’m doing or not doing but what?

From: [Question] How to Get Mouse Coordinates and Print its XY value - Programming & Scripting - Epic Developer Community Forums

So what is the point in the function I was calling?

Though there is still an offset from the actual cursor - with the arrow the offset seemed to be at the center but switching to crosshairs it’s not.

Well blow me down today the offset came back. This is all during PIE.

Clicking on objects works fine, the offset is all in 2d code. Should be simple as simple can be.

No-one else having problems with this?

Only get this during PIE. Standalone seems fine. Very annoying though as this is how a typically iterate!

The offset is the gap between the constrained game window during PIE and the editor window. I.e if there is a vertical gap at the top to the letter box window then the mouse will be offset vertically by that distance.

Still an issue with 4.6

Did you constrained your cameras aspect ratio?

Yes! And removing the constraint fixes the problem, which will keep me going for now but still seems like a bug.

Thanks for that pointer!