Search Unity

Bug InputSystem does not contain a definition for SaveAndReset and Restore.

Discussion in 'Input System' started by Moshu, May 7, 2023.

  1. Moshu

    Moshu

    Joined:
    Mar 13, 2015
    Posts:
    7
    Unity 2021.3.24f1
    Visual Studio 2019 and 2022 tried.
    I started get these errors tonight out of no where and cannot seem to resolve them. This has made it where the debugger won't attach or when it attaches it will hang for a min or more then finally hit a break point. The editor appears to be frozen during this time. This issue has made debugging a pain. I am unable to build the Unity.InputSystem.TestFramework.Player project. I have found no related links that have help resolve these issues.

    Severity Code Description Project File Line Suppression State
    Error CS0117 'InputSystem' does not contain a definition for 'SaveAndReset' Unity.InputSystem.TestFramework.Player D:\Repos\ZombTactics\ZombTactics\Library\PackageCache\com.unity.inputsystem@1.5.1\Tests\TestFixture\InputTestFixture.cs 94 Active
    Error CS0117 'InputSystem' does not contain a definition for 'Restore' Unity.InputSystem.TestFramework.Player D:\Repos\ZombTactics\ZombTactics\Library\PackageCache\com.unity.inputsystem@1.5.1\Tests\TestFixture\InputTestFixture.cs 168 Active
     

    Attached Files:

  2. Moshu

    Moshu

    Joined:
    Mar 13, 2015
    Posts:
    7
    By updating my manifest.json in Assets\Packages to go back to 1.4.1 Input System it fixed the issue.
    https://forum.unity.com/threads/input-system-1-4-1-released.1306062/
    I feel like this isn't ideal, but this was really killing my progress. I would still like to see a fix for this issue in 1.5.1. I have a copy of my project with this issue.
     
  3. Moshu

    Moshu

    Joined:
    Mar 13, 2015
    Posts:
    7
    Now my Q and E binds don't catch the press now. So not out of the woods. If I keep pressing it will get it eventually. Num 1-9 still work fine. I am enabling the PlayerInputActions in awake. Other keys work. It is just Q and E acting weird now.


    Code (CSharp):
    1.     private void HandleMoveOrInteractKeypresses()
    2.     {
    3.         if (InputManager.Instance.ShiftKeyIsPressed())
    4.             return;
    5.  
    6.         if (InputManager.Instance.EKeyPressedThisFrame())
    7.         {
    8.             SetSelectedUnitBaseActions();
    9.             SetSelectedAction(baseActions.Where(action => action is InteractAction).First());
    10.         }
    11.  
    12.         if (InputManager.Instance.QKeyPressedThisFrame())
    13.         {
    14.             SetSelectedUnitBaseActions();
    15.             SetSelectedAction(baseActions.Where(action => action is MoveAction).First());
    16.         }
    17.     }
    Code (CSharp):
    1.     public bool QKeyPressedThisFrame()
    2.     {
    3. #if USE_NEW_INPUT_SYSTEM
    4.         return playerInputActions.Player.QKey.WasPressedThisFrame();
    5. #else
    6.         return Input.GetKeyDown(KeyCode.Q);
    7. #endif
    8.     }
     

    Attached Files: