Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Cursor not locked.

Discussion in 'Scripting' started by Corrothon, Apr 25, 2021.

  1. Corrothon

    Corrothon

    Joined:
    Jun 11, 2019
    Posts:
    60
    I've had my cursor locked in my game since 2020 and today when I opened my project to work on it, it suddenly is unlocked. I edited the script and added "Cursor.lockState = CursorLockMode.Locked;" but it's still not locked! Is it because I imported Input System yesterday? Please help!
    Edit: The cursor is visible and I also have a MouseCursorInvisible script.
    Edit 2: Found out other people have the same problem.
    Edit 3: Managed to fix it!
     
    Last edited: Apr 26, 2021
  2. MartinMa_

    MartinMa_

    Joined:
    Jan 3, 2021
    Posts:
    455
  3. Corrothon

    Corrothon

    Joined:
    Jun 11, 2019
    Posts:
    60
    MartinMa_ likes this.