- Home /
Why does the Editor force the mouse to the center while using keyboard controls in Game?
I have my control scheme setup so that the player orients towards mouse, and would preferably move forward when holding down the arrow key axis - essentially a twin stick. However, I've noticed that under Unity 5.x, the editor is grabbing the mouse from a separated active Game window, which causes the vehicle to try to orient off-screen.
This is actually getting a bit annoying, as well as a hindrance - say, if I want to select inventory items with the mouse or activate a GUI element. Never mind that it prevents proper movement anyway. Has anyone encountered this bug, or have any times on how to fix it?
I'm operating on Windows 10, if perhaps this is an OS-related bug.
On further testing I'm finding this happening when I dock the Game window back, then undock it. Only this time it now forces a center on the Game window ins$$anonymous$$d of the Editor. This is slightly better, but it prevents the mouse from moving while using any keyboard control. I disabled Screen.lockCursor, but it made no difference.
Another quick addition: I just discovered that it's happening ONLY when I use axis keys - namely, horizontal and vertical. Strange?
Answer by DevMerlin · Sep 07, 2015 at 07:49 AM
Figured it out, and I feel stupid. NGUI was causing the issue, but it was due to my not properly setting up a camera configuration.
Hi,
I'm having the same problem, do you $$anonymous$$d sharing your solution?
thanks!
Looks like it's the "Auto Hide Cursor" option on the NGUI Camera, just toggle that puppy off.
Your answer
![](https://koobas.hobune.stream/wayback/20220612030007im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
I want switch Mouse's navigation in SceneView 0 Answers
Unity Lock Up and Mouse Clicking Issue 1 Answer
Capture input events before scene view does? 0 Answers
Locking the mouse cursor when orbiting camera in Unity Editor 0 Answers
How can I stop the middle mouse button from zooming out when I single click it inside the editor? 2 Answers