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
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    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:
    115
    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. TZ-

    TZ-

    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:
    288
    Also bumping. This is annoying and would be an easy fix.
     
  9. phil_lira

    phil_lira

    Unity Technologies

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

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    296
    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:
    227
    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:
    545
    We have a fix scheduled for upcoming 7.2.0 package.
     
    zhuchun, Thaina and misabiko like this.
  13. Jichaels

    Jichaels

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

    Jedyte28351

    Joined:
    Jan 2, 2020
    Posts:
    3
    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:
    120
    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:
    120
    @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:
    340
    Deleting the Library folder didn't work for me
     
  20. bsgbryan

    bsgbryan

    Joined:
    Nov 27, 2015
    Posts:
    20
    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,270
    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
  26. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    60
    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:
    1
    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:
    11
    Nope!
     
  30. LordOlives

    LordOlives

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