Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Why "Cursor.lockState" does not work?

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

  1. CGDever

    CGDever

    Joined:
    Dec 17, 2014
    Posts:
    156
    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,212
    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,212
    finally fixed by setting to None, waiting a frame then setting to confined -> locked