Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Unity Render Pipeline Debug clashes with New Input System

Discussion in 'Universal Render Pipeline' started by castleofwarriors, Aug 27, 2019.

  1. castleofwarriors

    castleofwarriors

    Joined:
    May 29, 2019
    Posts:
    3
    I recently upgraded to the Unity 2019.3 beta, and I found that I was immediately getting an error when I started my game;

    InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
    UnityEngine.Rendering.DebugManager.SampleAction (System.Int32 actionIndex) (at Library/PackageCache/com.unity.render-pipelines.core@7.0.1/Runtime/Debugging/DebugManager.Actions.cs:111)
    UnityEngine.Rendering.DebugManager.UpdateActions () (at Library/PackageCache/com.unity.render-pipelines.core@7.0.1/Runtime/Debugging/DebugManager.Actions.cs:168)
    UnityEngine.Rendering.DebugUpdater.Update () (at Library/PackageCache/com.unity.render-pipelines.core@7.0.1/Runtime/Debugging/DebugUpdater.cs:18)

    I checked, and sure enough, right there in the DebugManager class, I found this:

    foreach (var button in buttons)
    {
    allButtonPressed = Input.GetButton(button);
    if (!allButtonPressed)
    break;
    }

    Given that this is an engine file, not one I made myself, I don't feel comfortable altering it. How would I fix this issue?
     
  2. The-Oddler

    The-Oddler

    Joined:
    Nov 26, 2010
    Posts:
    125
    I noticed the same. Sadly I don't have a proper fix.

    Commenting out the part in the debugmanager does seem to get rid of the error, but only locally and will be overwritten when updating/resetting the package, but has no other bad effects that I noticed.

    This seems like an oversight (aka bug) in the Render Pipeline code, as the code shouldn't assume the usage of the old input system.
     
  3. T-Zee

    T-Zee

    Joined:
    Oct 23, 2017
    Posts:
    31
    I just encountered this while trying to convert over to the new input system package.

    the only advice i have found for this is to enable both input systems in player settings till it gets fixed
     
  4. KingRecycle

    KingRecycle

    Joined:
    Jul 20, 2013
    Posts:
    20
    Yeah, I got this issue in latest beta (2019.3b6). I thought maybe it was because I started with core RP and changed over to using URP, not sure if that is what anyone above did as well.
     
  5. misterHallodri

    misterHallodri

    Joined:
    Sep 8, 2013
    Posts:
    4
    Any news on this?
     
  6. Torgie

    Torgie

    Joined:
    Apr 7, 2015
    Posts:
    7
    Bumping for visibility.
     
  7. nbelkin

    nbelkin

    Joined:
    Jul 22, 2012
    Posts:
    5
    the problem still exists =)
     
  8. jesta

    jesta

    Joined:
    Jun 19, 2010
    Posts:
    292
    Also bumping. This is annoying and would be an easy fix.
     
    JeffreyBennett likes this.
  9. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    547
    iJuan and kavanavak like this.
  10. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    325
    As stated in the issue tracker page, a workaround of this problem is to set the Active Input Handling to Both in the Player Settings of your project.
     
  11. Jichaels

    Jichaels

    Joined:
    Dec 27, 2018
    Posts:
    235
    After more than 6 months for a really easy fix (like #if UNITY_INPUT_SYSTEM so it doesn"t spawn the DebugUpdater...) we're still supposed to hack/workaround it ?

    Please consider doing something, it's really annoying and should at least be an option to use these "debug" features
     
  12. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    547
    We have a fix scheduled for upcoming 7.2.0 package.
     
  13. Jichaels

    Jichaels

    Joined:
    Dec 27, 2018
    Posts:
    235
    Cool ! Looking forward to it :)
     
  14. Jedyte28351

    Jedyte28351

    Joined:
    Jan 2, 2020
    Posts:
    4
    I have a similar stacktrace, but it does not seem to come from URP:
    Code (CSharp):
    1. InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
    2. UnityEngine.Input.get_mousePosition () (at <2efdc780086b47f28399fd0ce7a4bfa4>:0)
    3. UnityEngine.UI.MultipleDisplayUtilities.GetMousePositionRelativeToMainDisplayResolution () (at C:/Program Files/Unity/Hub/Editor/2019.3.0f3/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/MultipleDisplayUtilities.cs:40)
    4. UnityEngine.EventSystems.BaseInput.get_mousePosition () (at C:/Program Files/Unity/Hub/Editor/2019.3.0f3/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/BaseInput.cs:75)
    5. UnityEngine.EventSystems.StandaloneInputModule.UpdateModule () (at C:/Program Files/Unity/Hub/Editor/2019.3.0f3/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:183)
    6. UnityEngine.EventSystems.EventSystem.TickModules () (at C:/Program Files/Unity/Hub/Editor/2019.3.0f3/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:331)
    7. UnityEngine.EventSystems.EventSystem.Update () (at C:/Program Files/Unity/Hub/Editor/2019.3.0f3/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:344)
     
    Last edited: Feb 8, 2020
    Awesome_Guy likes this.
  15. stephanedupont

    stephanedupont

    Joined:
    Dec 31, 2017
    Posts:
    14
    Still happen on 7.2.1.

    I see that the code is inside a
    Code (CSharp):
    1. #if ENABLE_LEGACY_INPUT_MANAGER
    region, but it still crashes. The code in the region seems to be executed even when the active Input Handling is set to the new Input System Package.

    Known problem? Am I missing something?
     
    JimmyCushnie likes this.
  16. JimmyCushnie

    JimmyCushnie

    Joined:
    Jun 7, 2017
    Posts:
    137
    I'm getting the same problem as you, @stephanedupont. ENABLE_LEGACY_INPUT_MANAGER is not in my project's Scripting Define Symbols.
     
  17. JimmyCushnie

    JimmyCushnie

    Joined:
    Jun 7, 2017
    Posts:
    137
    @stephanedupont I figured it out! Unity's internal scripting define symbols do not get updated until the entire project is reimported. This is because the system was designed for platform dependent compilation, and when the editor switches platforms a reimport all is performed.

    You can fix the issue with right click -> reimport all in the Project window or by deleting your project's Library folder.
     
  18. stephanedupont

    stephanedupont

    Joined:
    Dec 31, 2017
    Posts:
    14
    Thank you!
     
    JimmyCushnie likes this.
  19. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    344
    Deleting the Library folder didn't work for me
     
  20. bsgbryan

    bsgbryan

    Joined:
    Nov 27, 2015
    Posts:
    22
    I can confirm that "Reimport All" cleared fixed things for me; after running "Reimport All" I can play my scene and not get the input related errors.

    Thank you @JimmyCushnie!
     
    Last edited: Apr 7, 2020
    JimmyCushnie likes this.
  21. Awesome_Guy

    Awesome_Guy

    Joined:
    Dec 31, 2019
    Posts:
    1
    Same problem, still not fixed...
     
  22. unity_-bMtscXP-akGzw

    unity_-bMtscXP-akGzw

    Joined:
    Apr 16, 2020
    Posts:
    1
    Same problem,
    reimporting didn't fix problem.
     
  23. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,483
    The error is from having StandaloneInputModule in the scene, which is the UI input module for the old input system. If you select the EventSystem GameObject, you should see a "Replace with InputSystemUIInputModule" button in the inspector for the StandaloneInputModule component. Clicking that button and saving the scene should fix the error.

    Hopefully we'll find a better way to make this visible/fixable.
     
  24. MathieuTournadre

    MathieuTournadre

    Joined:
    Nov 4, 2013
    Posts:
    1
    Hi all,

    I got the same issue on my project. I fixed it by reimporting the "Core RP Library" package from th eproject window (Right clic on "Packages>Core RP Library" then "Reimport") :)
     
  25. amattdev

    amattdev

    Joined:
    Oct 28, 2019
    Posts:
    1
    This issue has me at my wits end.

    Reimports do not work, updating Core RP to 7.2.1 does not work (Version 7.2.1 literally does not work, throwing errors immediately on import). I don't feel comfortable enabling both Input systems, that defeats the purpose of upgrading to the new one.

    The only fix I could manage was physically commenting out every instance of Input._____ in DebugManger.Actions, which just feels messy and half-baked.

    Edit: Resolved the problem by gutting the DebugUpdater as well. I'm not a fan of having objects that I didn't put into my hierarchy injected into my scene without warning, especially when those objects become the reason why my game no longer functions.
     
    Last edited: May 1, 2020
    tomachinz likes this.
  26. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    70
    Are you sure about that? I don't have the StandaloneInputModule OR the InputSystemUIInputModule in the scene. But when I selected JUST the new Input System in the Player Settings, I got the spammed errors. Reimporting all DID fix the issue though.
     
  27. venay0

    venay0

    Joined:
    Aug 26, 2019
    Posts:
    7
    Project Settings > Player > Active Input Handling change it to both

    This fixed the issue for me.
     
    kvsr, oldManPig, SravanSTG and 6 others like this.
  28. angelsafor

    angelsafor

    Joined:
    Mar 21, 2020
    Posts:
    1
    Thanks. This works!!
     
  29. tclancey

    tclancey

    Joined:
    May 19, 2017
    Posts:
    139
    Nope!
     
  30. LordOlives

    LordOlives

    Joined:
    Aug 24, 2015
    Posts:
    3
    This fixed it for me. Thanks.
     
  31. Shruzberry

    Shruzberry

    Joined:
    Mar 21, 2015
    Posts:
    1
    Simply update it using the inspector
    upload_2020-5-30_11-22-5.png
     
  32. Alean909

    Alean909

    Joined:
    Jul 2, 2020
    Posts:
    1
    it work
     
  33. FranekKimono

    FranekKimono

    Joined:
    May 22, 2013
    Posts:
    1
    For those that are still struggling with this, remember to implement this change in ALL the scenes in your project. Even ones you don't include in your build.
     
  34. OGNE

    OGNE

    Joined:
    Jun 9, 2017
    Posts:
    10
    This Fixed my issues. Thanks a lot.
     
  35. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    98
    I have no EventSystem GameObject in my scene but I have Cinemachine. It doesn't work, chaining to Both in player settings just throw errors saying that the input is not setup. Cinemachine tries to read the old input and doesn't find the values there. what do i do?
     
  36. learntodevelopecom

    learntodevelopecom

    Joined:
    Aug 2, 2020
    Posts:
    1
    Reset the Player Setting
     
  37. Jhakas_Keshav

    Jhakas_Keshav

    Joined:
    Oct 6, 2020
    Posts:
    1
    hey guys!!! please help me i am a newbie

    InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.


    this thing is coming as error please please please solve this
     
  38. MisterRogers

    MisterRogers

    Joined:
    Mar 15, 2015
    Posts:
    4
    I think this means the method of reading Inputs doesn't match the Input system you chose in the Player Settings. You can probably change this by choosing BOTH.
    If you want to use the new input system you should watch or do a tutorial on it.
     
    Jhakas_Keshav likes this.
  39. andrmhndr11

    andrmhndr11

    Joined:
    Oct 10, 2020
    Posts:
    1
    yea me tooo
     
  40. lcompton

    lcompton

    Joined:
    Mar 31, 2018
    Posts:
    4
    I just started seeing this when I upgraded to 2020.1.9f1. I did not see the error in previous versions of 2020...

    Code (CSharp):
    1. InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
    2. UnityEngine.Input.get_mousePosition () (at <5d1d5a0a7c19404a97ceefd28864629e>:0)
    3. UnityEngine.UI.MultipleDisplayUtilities.GetMousePositionRelativeToMainDisplayResolution () (at C:/Program Files/Unity/Hub/Editor/2020.1.9f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/MultipleDisplayUtilities.cs:40)
    4. UnityEngine.EventSystems.BaseInput.get_mousePosition () (at C:/Program Files/Unity/Hub/Editor/2020.1.9f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/BaseInput.cs:75)
    5. UnityEngine.EventSystems.StandaloneInputModule.UpdateModule () (at C:/Program Files/Unity/Hub/Editor/2020.1.9f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:175)
    6. UnityEngine.EventSystems.EventSystem.TickModules () (at C:/Program Files/Unity/Hub/Editor/2020.1.9f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:328)
    7. UnityEngine.EventSystems.EventSystem.Update () (at C:/Program Files/Unity/Hub/Editor/2020.1.9f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:343)
     
  41. lcompton

    lcompton

    Joined:
    Mar 31, 2018
    Posts:
    4
    Quick update: Changing "Active Input Handling" to "Both" in "Player Settings" eliminated the error, as others have mentioned. However, I think it's odd that it just started happening for me. Seems like a bug.
     
unityunity