Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. 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

UGUI throws error when used with new Input System

Discussion in 'UGUI & TextMesh Pro' started by Jedyte28351, Feb 8, 2020.

  1. Jedyte28351

    Jedyte28351

    Joined:
    Jan 2, 2020
    Posts:
    3
    I see the following stacktrace every Update:

    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)
    Strange thing is, it only appeared after I restarted Unity.
    I use 2019.3.0f3

    I know there is a similar issue (https://issuetracker.unity3d.com/is...42.1224778911.1581113660-871491889.1576850238) in the URP package, but I do not use that package.
     
  2. JimmyCushnie

    JimmyCushnie

    Joined:
    Jun 7, 2017
    Posts:
    132
    If you're using the new input system, you're supposed to be using the new EventSystem that comes included.
     
    Jedyte28351 likes this.
  3. Jedyte28351

    Jedyte28351

    Joined:
    Jan 2, 2020
    Posts:
    3
    Thank you JimmyCushnie!
    I use the new EventSystem everywhere, but apparently forgot to use it in one scene. That was it.
     
    JimmyCushnie likes this.
unityunity