Forum Discussion
jonathantopf
5 years agoHonored Guest
Unity Cursor Locking & mouse delta issues
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:
And retrieve the cursor delta with this line
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?
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?
No RepliesBe the first to reply
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 years ago
- 1 year ago
- 1 year ago