Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Question [Unity2020.1.0b11] Input System's XRSupport.cs file error - common fix not working

Discussion in 'Input System' started by Adromadus, Jun 18, 2020.

  1. Adromadus

    Adromadus

    Joined:
    Mar 8, 2020
    Posts:
    1
    Hello all!

    I am currently working in Unity2020.1.0b11 on a project with the new Input System enabled (1.0.0).

    This error is in my way currently.
    Library\PackageCache\com.unity.inputsystem@1.0.0\InputSystem\Plugins\XR\XRSupport.cs(108,16): error CS1069: The type name 'InputDeviceCharacteristics' could not be found in the namespace 'UnityEngine.XR'. This type has been forwarded to assembly 'UnityEngine.XRModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' Enable the built in package 'XR' in the Package Manager window to fix this error.


    - XR & VR package was already enabled - disabling & re-enabling it makes no difference
    - NET 4.x in Project Settings
    - Changing up the Active Input Handling makes no difference
    - The DEFINES (UNITY_INPUT_SYSTEM_ENABLE_XR & VR) in Player Settings make no difference

    The project will not make use of anything XR / VR related at all.

    The only thread I can find is
    https://forum.unity.com/threads/dependency-on-the-vr-xr-built-in-packages.866182/
    Didn't help me solve my problem.

    I'd gladly embrace your ideas / potential fixes!
     
    Last edited: Jun 18, 2020
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,207
    If you will not be using VR or XR then try removing any VR and XR packages and disable the built-in modules(package manager builti tab).
    There are some issues with the XR/VR define but this should fix it for now
     
    Adromadus likes this.
  3. AmitloafTotes

    AmitloafTotes

    Joined:
    Jul 10, 2018
    Posts:
    26
    This worked for me .Thank you
     
  4. WavyRancheros

    WavyRancheros

    Joined:
    Feb 5, 2013
    Posts:
    165
    Hi Karl,

    I am trying to write my own ActionBasedController without the XR Interaction Toolkit. I tried to define my own Input Actions and noticed that the XRHMD class is not included because it has a
    #if UNITY_INPUT_SYSTEM_ENABLE_XR
    define.

    How can I enable this without including the XR Interaction Toolkit package?

    For now, I made a copy of the com.unity.inputsystem\InputSystem\Plugins\XR\GenericXRDevice.cs file, changed the namespace and removed the define.

    But it would be better if I could set the define somewhere with my own Interaction Toolkit
     
    Last edited: Jan 27, 2021
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,207
    If you enable the define without the module then you will get lots of compiler errors due to missing classes.
    You can override the defining of UNITY_INPUT_SYSTEM_ENABLE_XR through the player settings
    upload_2021-1-27_13-39-42.png
     
  6. WavyRancheros

    WavyRancheros

    Joined:
    Feb 5, 2013
    Posts:
    165
    Thanks!

    If the XR Interaction Toolkit is not imported as a package, I cannot find, for example, "Primary 2D Axis / Left Hand XR Controller" ("<XRController>{LeftHand}/{primary2DAxis}"), when creating my own InputActions. Are these binding defined somewhere inside the XR Interaction Toolkit package?

    *EDIT*

    Why is there such a strong dependency between the XR Interaction Toolkit and the Input System?

    I would like to access the inputs from any XR device without being forced to use the XR Interaction Toolkit. You also don't do a Console Interaction Toolkit so that I can access inputs from gamepad devices.
     
    Last edited: Jan 27, 2021