Skip to main content
Participant
May 8, 2016
Solved

Cursor Lock unavailable ?

  • May 8, 2016
  • 31 replies
  • 6821 views
Hello,
I recently tried to update some old "0.6" app to the new "1.3" drivers - it's a seated experience where the user can look at various UI elements to 'click' them.

For this, I lock the cursor in the middle via Cursor.lockState and just use the standard Unity UI (with in-world Canvas). Everything worked fine before, and still work in the editor - but not once built.

With a built app, if I have both the Oculus API and "Virtual Reality Support" enabled (in Unity's player options), the LockState stay at "none" - whatever my scripts try to do. Removing the Oculus plugin or unchecking "VR Supported" put thing back to normal, but then the Oculus doesn't work.

This is very problematic because it make the whole "look at a button to press it" concept very uncomfortable, as it force the user to manually center his cursor at the app's start (and moving accidentally your mouse mess up everything). This problem appear even on a new, nearly empty project with just the Oculus plugin and a few scripts trying to mess with the cursor's state.

Is this an intended behavior, or a bug ?
In any case, does someone have a way to correct it ?

I could add Colliders to every UI elements and then perform ray test from the camera, but that's basically recreating Unity's UI/EventSystem in a less optimized way.
This topic has been closed for replies.
Best answer by vrdaveb
Using the Windows mouse cursor with VR is not recommended. We've written a better gaze-based cursor system for Unity's UI, which you can read more about at https://developer.oculus.com/blog/unitys-ui-system-in-vr.

31 replies

Inspiring
August 28, 2016
It does sound like a possible per-object culling issue. If you're using Camera scaling, be sure to scale your near and far clip planes by the same amount.

> I have no easy way of replicating it without providing my whole project.

If you click Help > Report a bug..., it will upload your whole project (securely and under NDA) for Unity to reproduce on their end.