Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice
  2. We've opened up a space to discuss, share feedback, and showcase everything related to the Unity Shader Graph! Come show us what you've made.
    Dismiss Notice

Why "Cursor.lockState" does not work?

Discussion in 'Documentation' started by Rotecks, Jun 29, 2018.

  1. Rotecks

    Rotecks

    Joined:
    Dec 17, 2014
    Posts:
    53
    Hello to everyone, especially the Unity team.
    I have a very simple question. Why Cursor.LockState still does not work?

    0) I had this problem for a long time, maybe a year ago.
    1) I studied the documentation: https://docs.unity3d.com/ScriptReference/Cursor-lockState.html
    2) I was looking for an answer in the network:
    https://forum.unity.com/threads/cursor-lockstate-troubles.278221/
    https://forum.unity.com/threads/locking-the-mouse.294453/#post-1941423
    https://answers.unity.com/questions/1020927/cursorlockstate-not-working.html

    From this it can be seen that this mistake has already taken place for more than 3 years.

    Guys, it's time for great achievements, you need to fix it;)
     
  2. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,027
    Just upgraded to 2018.2.2, the latest and greatest. Was never a problem before. Now my cursor won't lock after any alt-tabbing ruining all sort of first person tracking. Still can't find a fix except for a mention that it's fixed in 2018.3 =[
     
  3. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,027
    finally fixed by setting to None, waiting a frame then setting to confined -> locked