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. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Is there a list of XR.InputDevice.Name strings?

Discussion in 'AR/VR (XR) Discussion' started by Cela1, May 11, 2020.

  1. Cela1

    Cela1

    Joined:
    Jul 7, 2019
    Posts:
    2
    I want to differentiate between controller types, and the best way I've seen is using XR.InputDevice.Name (if there is a better way, please do share). Using my Oculus Touch (v1) controllers I get the strings "Oculus Touch Controller - Left" and "Oculus Touch Controller - Right", is there a list of the strings for major controller types (Vive, WMR, Index)?
     
  2. ChrisHandzlik

    ChrisHandzlik

    Joined:
    Dec 2, 2016
    Posts:
    62
    I'm after the same thing, have you ever found it?
     
  3. vadimtihonyuk

    vadimtihonyuk

    Joined:
    Feb 26, 2018
    Posts:
    32
    I'm parsing device name and then map result to controller models
     
  4. colinleet

    colinleet

    Joined:
    Nov 20, 2019
    Posts:
    141
    If you're looking for pre-OpenXR device names this way of doing it will only work till you upgrade, afterwards that information is hidden behind OpenXR's unity API at the moment. It's best to currently just ask the user what headset they're using from what I've gathered; I have a long and detailed post about this problem here for those who need it. It also contains some of the (legacy) device names you're looking for.

    https://forum.unity.com/threads/ope...escriptive-device-names.1051493/#post-7586047
     
    Last edited: Nov 6, 2021
    ChrisHandzlik likes this.
  5. ChrisHandzlik

    ChrisHandzlik

    Joined:
    Dec 2, 2016
    Posts:
    62
    Thanks, that's very helpful

    @vadimtihonyuk do you have a full list of device strings?

    I know of few on OpenXR side
    "Oculus Touch Controller OpenXR", "Windows MR Controller OpenXR", "Index Controller OpenXR", "HTC Vive Controller OpenXR"

    But I'm looking for a more compehensive list for different XRPlugins (eg. OpenVR, Oculus, Windows Mixed Reality) - I know of some, but withouth those headsets I can't work out the others.

    I was hoping there'd be some mapping property / file somewhere on c# or c++ side of Unity.
     
    Last edited: Nov 9, 2021
  6. colinleet

    colinleet

    Joined:
    Nov 20, 2019
    Posts:
    141
    Yes just be warned that "Oculus Touch Controller OpenXR" will return the same thing for any of the Oculus controller. or any controller which use the same button layout [Rift 1, Quest 2, and bizarrely the HP Reverb G2, if not more]. You can't really use them to tell apart different headsets even with the same button layout. It's best to use a drop down to future proof yourself in my opinion.
     
unityunity