At some point in the game it stops updating MousePosition.X and MousePosition.Y and the coordinates that are saved to MousePosition stay the same.
This also is hard to replicate. It does not or very very rarely happen on my computer, but on other machines this bug occurs much too often.
So I wanted to ask, if anyone here knows, what needs to happen, that GetMousePosition stops updating? I also tried to use the windows library function GetCursorPos(&p) but this also does not fix this bug.
Am I losing the focus? What causes this behavior?
Where do you use these functions? One of them should be in tick, the other one in the construction script/ begin play. Other than that, these are the right function calls. Would try to print out a bool that shows if your PlayerController is valid and check if that’s the issue.
Thanks for the reply.
I use this within an Actor Component, tied to two different objects in our game.
Have been trying around since I posted my problem and now I am able to trigger this bug: calling our pause menu (a widget), clicking resume and BOOM → mouse position is not tracked anymore.
I dont know what happens there, since we set the game modes back to game only the mouse should work properly again =/
no it doesn’t change anything. And since this happens after clicking the resume button I think this problem is caused within this whole pause-widget thing
Yeah, Setting the Input to Game only calls SetMouseLockMode. You can set the Input to Game and UI, but some more explanation would be great why you need to track the mouse position when you are “ingame”.
I have a mechanic in it, where you need to rotate your mouse in order to screw down a screw. so I need the mouse coordinates to translate them into rotation and movement of an object