- Home /
Screen.LockCursor not working in Windows Store apps?
I'm trying to export a game that uses the First Person Controller prefab as a Windows Store app, but Screen.LockCursor doesn't appear to be working. In a custom script of mine I have it calling Screen.LockCursor = true at Start() and whenever the mouse left clicks and it won't work. The cursor stops at the edges of the screen and won't go any further (and it activates the Windows 8 hot corners). I've also tried calling Screen.LockCursor every Update(), but that doesn't appear to work either. Am I doing something wrong? Or is this a Unity bug/limitation? I've tried exporting as a D3D11 C++ project, as a XAML C++ project and as a D3D11 C# project, but none of those have worked. All my scripts are written in C#.
EDIT: I set a GUI label to appear when Screen.lockCursor == true, and that label appears in the editor and if I export it as a desktop game. Doesn't show up in the Windows Store app though. So something seems to be disabling it on its own. Or it isn't supported. There's no mention of it not working in the documentation though :/