All Oculus Quest developers MUST PASS the concept review prior to gaining publishing access to the Quest Store and additional resources. Submit a concept document for review as early in your Quest application development cycle as possible:

For additional information and context, please see "Submitting Your App to the Oculus Quest Store".
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Unity Cursor Locking & mouse delta issues

jonathantopfjonathantopf Posts: 1
edited May 20 in Oculus Quest Development
I'm trying to build a simple FPS with a mouse connected via the USB port to control the crosshair using unity but I'm finding that the mouse values I receive get clamped.

I initialize cursor controller like so:

void Start ()
    UnityEngine.Cursor.lockState = CursorLockMode.Locked;
And retrieve the cursor delta with this line
var delta = new Vector2 (Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
The behavior I'm seeing is that the delta is returned fine to begin until I hit the edge of an invisible wall At that point the delta values become zero in the axis of the wall I hit.

When I log UnityEngine.Cursor.lockState out on a device build it says that it's no longer locked.

It seems to me that two things could be going on
- The cursor is not being locked, and the feature is not supported
- Something is unlocking the cursor lock

Can anybody shed any light on what's going on here?
Sign In or Register to comment.