Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    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:
    4
    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.
     
    whtnoiseblktie likes this.
  2. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    201
    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:
    4
    Thank you JimmyCushnie!
    I use the new EventSystem everywhere, but apparently forgot to use it in one scene. That was it.
     
    cxode likes this.
unityunity