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

Resolved XR Device Simulator WASD inputs ignored

Discussion in 'XR Interaction Toolkit and Input' started by krank23, Oct 9, 2022.

  1. krank23

    krank23

    Joined:
    Dec 10, 2013
    Posts:
    3
    Is anyone else having problems getting WASD inputs to work? I've tried Unity 2021.3.11 and 2020.3.40, and I'm at the end of my rope.
    • I'm adding the packages (XR Toolkit, XR Plugin Management) and both Starter Assets and XR Device Simulator "samples".
    • I'm adding the Starter Asset presets as default configs.
    • I'm adding an XR Origin (Action-based), an Interaction Manager component and a Input Action Manager.
    • I'm adding the XRI Default Input Actions to the Input Action Manager. Everything works fine when connecting to an actual headset.
    • I'm adding the XR Device Simulator prefab to the scene.
    • I'm making sure the Input system is New or Both in Player Settings.
    But when I try to simulate… Well, the mouse works. Shift and Space works. R works. So it seems like the system isn't having problems detecting keyboard inputs.

    It's just not very interested in WASD or Q/E.

    I know this was working before, and I swear I'm following the same steps… Any suggestions greatly appreciated. Is this me forgetting something, or is it a bug?
     
    Last edited: Oct 9, 2022
  2. krank23

    krank23

    Joined:
    Dec 10, 2013
    Posts:
    3
    I managed to get it working on 2020.3.34 and 2020.3.40, though I had to add the XR Toolkit package manually to the json file in the case of 2020.3.40.

    Still having problems with 2021.3.11 though. I'm not doing anything different; taking the same steps just results in different outcomes.

    EDIT: I tried forcing a newer version of the plugin in 2021.3.11. Recommended verison was 2.0.3 (didn't work), and the 2020.3.x versions worked fine with 2.1.1.

    Reimported everything, recreated the scene. No change. Seems like it's a 2021.x issue, rather than a plugin version issue.
     
    Last edited: Oct 9, 2022
  3. chris-massie

    chris-massie

    Unity Technologies

    Joined:
    Jun 23, 2020
    Posts:
    211
    UPDATE (2022-10-26): The shortcut support in Input System package is changing to be opt-in for version 1.4.4 and this script below will not be necessary with that version.
    ---

    I think this may be an issue caused when using the Input System package at version 1.4.0 or higher. If you are referring to using the WASD keys for keyboard translation (done by pressing 3 to toggle that feature), that feature is currently conflicting with the same keyboard keys bound to other input actions in composite bindings used by the simulator.

    As a workaround to resolve the issue until a permanent fix is in place, try disabling the keyboard shortcuts feature of Input System by adding this component to a GameObject:

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.InputSystem;
    3.  
    4. [DefaultExecutionOrder(-30000)]
    5. public class ShortcutDisabler : MonoBehaviour
    6. {
    7.     protected void Awake()
    8.     {
    9.         // Disable Input System 1.4.0 shortcut feature by adding this component to an enabled GameObject
    10.         // in your main/first scene.
    11.         // See https://docs.unity3d.com/Packages/com.unity.inputsystem@1.4/changelog/CHANGELOG.html#140---2022-04-10
    12.         InputSystem.settings.SetInternalFeatureFlag("DISABLE_SHORTCUT_SUPPORT", true);
    13.     }
    14. }
     
    Last edited: Oct 26, 2022
  4. krank23

    krank23

    Joined:
    Dec 10, 2013
    Posts:
    3
    Thank you!

    Yeah, that's what I was referring to, sorry I wasn't clear.

    And I can confirm the workaround works like a charm!
     
    chris-massie likes this.
  5. djhatvr

    djhatvr

    Joined:
    Sep 22, 2019
    Posts:
    32
    Seems that 1.4.4 XR bindings disable keyboard bindings in PC builds (works fine in Editor). I spent close to a week debuging this. I had to put keyboard bindings in a separate game object with a separate InputAction.
     
  6. dronelius

    dronelius

    Joined:
    Jan 23, 2023
    Posts:
    1
    just wanted to let yall know i had this same issue but resolved it by updating my xr interaction toolkit package in the package manager window!
     
    VRDave_Unity likes this.
  7. kentg1

    kentg1

    Joined:
    Dec 22, 2014
    Posts:
    161
    I got mine to work by getting the XR Interaction 2.3 loaded - BUT you then have the XR simulator settings in your package manager