Search Unity

Resolved [2021.2.0b15] UIElement breakage with Input System package

Discussion in 'UI Toolkit' started by Deleted User, Oct 8, 2021.

  1. Deleted User

    Deleted User

    Guest

    Prevents from playing in the editor.

    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.UIElements.DefaultEventSystem+Input.GetAxisRaw (System.String axis) (at <7b54c84c069d40889365f862deac055a>:0)
    UnityEngine.UIElements.DefaultEventSystem.GetRawMoveVector () (at <7b54c84c069d40889365f862deac055a>:0)
    UnityEngine.UIElements.DefaultEventSystem.ShouldSendMoveFromInput () (at <7b54c84c069d40889365f862deac055a>:0)
    UnityEngine.UIElements.DefaultEventSystem.SendInputEvents () (at <7b54c84c069d40889365f862deac055a>:0)
    UnityEngine.UIElements.DefaultEventSystem.Update (UnityEngine.UIElements.DefaultEventSystem+UpdateMode updateMode) (at <7b54c84c069d40889365f862deac055a>:0)
    UnityEngine.UIElements.UIElementsRuntimeUtility.UpdateRuntimePanels () (at <7b54c84c069d40889365f862deac055a>:0)
    UnityEngine.UIElements.UIElementsRuntimeUtilityNative.UpdateRuntimePanels () (at <763a76321e7642019f1a53b345345afc>:0)
     
    Hinuko likes this.
  2. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    Hello! You need to make sure you have an EventSystem on your scene (GameObject > UI > Event System or right click the Hierarchy view > UI > Event System) and on the Inspector click to "Replace with InputSystemUIInputModule":

     
    Hinuko likes this.
  3. Deleted User

    Deleted User

    Guest

    Ok if Event System is required why is it not automatically added into scene when adding UIDocument. That what happens with the Canvas UI. You could also have a message somewhere saying "Event System required."

    I was under the impression that all of this was included when using UIDocument.
     
  4. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    700
    It's only required if you're using the new Input System, if you're not using it, we don't need this component.

    You're right that this is not the best workflow on our side, and I can assure you we're actively working on improving user experience :)
     
    Deleted User likes this.
  5. Deleted User

    Deleted User

    Guest

    Glad to hear. Thank you for your help.
     
    JuliaP_Unity likes this.