Search Issue Tracker

Fixed in 2018.1.X

Votes

0

Found in

2018.1.0a1

2018.1.4f1

Issue ID

1049632

Regression

Yes

After Alt+Tab command CursorLockState.Locked stops working

Themes

-

Setting Cursor.lockState to Locked works normally at first, but after alt-tabbing to another window and back to the Unity editor (or player) the mouse becomes unlocked. It remains invisible while in the game window but can move outside of it.

To reproduce:

1. Download attached project "CursorLockBug.zip" and open in Unity
2. Open "SampleScene" scene
3. Enter Play mode
4. Move the mouse and observe that mouse is not visible
5. Alt+Tab to switch to another window
6. Alt+Tab to switch back to the Unity window
7. Move the mouse and observe that mouse becomes visible outside Game window

Notes:
- This issue appears both on Windows and OSX
- Workaround: Setting every frame and enabling "run in background" appears to work around the issue

Reproduced on Unity 2018.1.0a1, 2018.1.6f1, 2018.2.0b9 and 2018.3.0a2
Not reproduced on Unity 2017.4.6f1
Regression on Unity 2018.1.0a1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.