Search Unity

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:
    133
    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.
     
    sunnivaaa likes this.
  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:
    26
    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.
     
    gpsiGame likes this.
  7. nbelkin

    nbelkin

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

    jesta

    Joined:
    Jun 19, 2010
    Posts:
    294
    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:
    584
    Robo_Gardener, iJuan and kavanavak like this.
  10. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    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:
    237
    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:
    584
    We have a fix scheduled for upcoming 7.2.0 package.
     
  13. Jichaels

    Jichaels

    Joined:
    Dec 27, 2018
    Posts:
    237
    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
  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?
     
    cxode likes this.
  16. cxode

    cxode

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

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    @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!
     
    cxode likes this.
  19. gegagome

    gegagome

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

    bsgbryan

    Joined:
    Nov 27, 2015
    Posts:
    26
    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
    cxode likes this.
  21. Vojta_

    Vojta_

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

    unity_-bMtscXP-akGzw

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

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    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") :)
     
    warapuri likes this.
  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:
    106
    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.
     
  28. angelsafor

    angelsafor

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

    tclancey

    Joined:
    May 19, 2017
    Posts:
    143
    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:
    2
    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. Vi-V-eK

    Vi-V-eK

    Joined:
    Jun 9, 2017
    Posts:
    11
    This Fixed my issues. Thanks a lot.
     
    jmcusack likes this.
  35. altepTest

    altepTest

    Joined:
    Jul 5, 2012
    Posts:
    1,115
    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:
    5
    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:
    102
    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:
    102
    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.
     
    SkrobieDev likes this.
  42. deex

    deex

    Joined:
    Feb 21, 2020
    Posts:
    3
    Worked for me too: Project Settings -> Player -> Active Input Handling : Both
     
  43. zammle2009wtf

    zammle2009wtf

    Joined:
    May 30, 2018
    Posts:
    5
    It worked! Simple answer, straight and forward, 10/10!
     
  44. shindy001

    shindy001

    Joined:
    Sep 8, 2018
    Posts:
    1
    For those that use Cinemachine (all of us), some cameras has default standard input values (did not try all of them). You need to remove them when using only the new input system or these errors occur. See screenshot bellow.

    upload_2020-12-5_14-41-29.png
     
    malohr, ideletemyself and Jeison_ like this.
  45. ChazBass

    ChazBass

    Joined:
    Jul 14, 2013
    Posts:
    153
    Unbelievable. Not just that it is still not fixed in the base build (meaning without having to swap out the script in the Event System and fix it everywhere else, or set input to both), but more importantly: How does something like this get out the door in the first place? Software companies of any size have regression test harness as part of their build processes. If Unity had such, the developer(s) creating the new input system would have seen it fail *immediately* when they checked in their code and merged their branch. There would be no possible way to ship this bug. Obviously that didn't happen. Makes me wonder what kind of QA Unity actually has in place.
     
    unity_AKFX_BYPqggzNg likes this.
  46. marufdhaka

    marufdhaka

    Joined:
    Oct 25, 2020
    Posts:
    4
    When you migrate to new input system, you have to add InputSystemUIInputModule on your canvas element, pointer behavior: Single unified Pointer (optional)
     

    Attached Files:

    Kelos likes this.
  47. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    Pretty disappointed this is still a thing, simply making a Canvas spams this error due to it not automatically having the InputSystemUIInputModule
     
  48. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    Getting this even when having Active Input Handling set to "both" and replacing the StandaloneInputModule with InputSystemUIInputModule

    2021.1b5, InputSystem 1.0.2, render-pipelines.core 11.0.0
     
    RedHillbilly likes this.
  49. contact_unity857

    contact_unity857

    Joined:
    Mar 3, 2020
    Posts:
    1
    Will this be fixed someday ? This basic issue was repported more than a year ago... Always having to enable "both" then relaunch unity and wait all the time is getting very annoying.
     
  50. sushil9394l

    sushil9394l

    Joined:
    Aug 2, 2020
    Posts:
    6
    Fixed The Problem By Upgrading URP to 7.4.3 .
    :)