Search Unity

Bug New Input System 1.0.0 breaks Cursor.visible functionality

Discussion in 'Input System' started by HunterAhlquist, Sep 6, 2020.

  1. HunterAhlquist

    HunterAhlquist

    Joined:
    Oct 6, 2013
    Posts:
    132
    Tested in 2020.1.4f1, 2019.4.9 (LTS)

    STEPS TO REPRODUCE:
    1. Create a new project with the blank standard 3d template (to reduce other factors).
    2. Create a script with this code snippet for cursor lock/visibility testing:
    Code (CSharp):
    1. void Start()
    2.     {
    3.         Cursor.lockState = CursorLockMode.Locked;
    4.         Cursor.visible = false;
    5.     }
    3. Attach script to the camera in the generated sample scene you get with new projects.
    4. Play-test and note that the cursor is both locked and invisible (until you press escape that is)
    5. Go to the Package Manager and install Input system version 1.0.0.
    6. Play-test again and note that the cursor is locked BUT visible despite Cursor.visible being set to false.

    Probing the variable with a log command shows that it remains false and never changes to 'true' at anytime.
    I would upload my test project but 33mb is too big.
     
  2. HunterAhlquist

    HunterAhlquist

    Joined:
    Oct 6, 2013
    Posts:
    132
  3. Virtua-Sinner

    Virtua-Sinner

    Joined:
    Mar 4, 2021
    Posts:
    2
    This explains my problem, then. I'm using the new input system. Combat state of the game starts with cursor invisible. If you press escape, it pauses the game and brings up a menu. If you click "Resume" it hides the cursor and resumes the game, as it should. But if you press escape again to resume the game, the cursor stays visible despite the fact that repeated tests show both methods of unpausing call the EXACT SAME METHOD. Infuriating.
     
  4. marartb1

    marartb1

    Joined:
    Mar 4, 2021
    Posts:
    5
    Im realize that sometimes Unity import by himself ui.experimental in package import.Removed and will work.
    ,at last for me.
    pd: I'm on unity2022.