Search Unity

Question OpenXR + Oculus Quest Linked Head Tracking Works But Controllers Don't

Discussion in 'XR Interaction Toolkit and Input' started by Hotshot10101, Jan 15, 2021.

  1. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    I have watched a couple video tutorials and read several posts. I want to start a new VR game for SteamVR and eventually the Quest. For now I am just trying to get it working in the Unity Editor so I can develop the game.

    I ended up with Unity 2020.2 + OpenXR + Action Based Input XR system in Unity.

    I followed Andrew's video here:


    I did the presets and preview packages and all as indicated in that video.

    I have an Oculus Quest 2. I am able to play all SteamVR games using both Virtual Desktop and Oculus Link cables. I also play Elite Dangerous with both of those setups, so I know the head tracking and controllers all work on this PC.

    I have also installed the latest SteamVR [beta] 1.16.1 and verified that all my games still work fine. I have all the latest packages for XR and VR and have selected as best I can tell all the correct options in the Unity project settings.

    When I hit play on my game Oculus and SteamVR both start up and I can see my scene. When I move my head around the head tracking works great.

    The problem is that the controllers do nothing. I can see the red "lines" from the controllers sitting on the ground.

    It doesn't matter whether I am using the Link cable or Virtual Desktop.

    When I look at the SteamVR window showing the status of the headset and controllers they all show good and tracking as you can see in this image: https://drive.google.com/file/d/1l5afV1mSR4DI4lvE0k2pGPtW2C28AZ41/view?usp=sharing

    Any idea why the controllers don't work?
     
    Evgeni_Incineration likes this.
  2. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Check your project settings for XR / OpenXR / Features and make sure Oculus Controller Support is enabled.
     
  3. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
  4. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    Do I have to have any Oculus components as part of the XR Settings in Unity or can I just have OpenXR? Keep in mind that the head tracking works.
     
  5. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Few more things to try

    1) Try using the oculus runtime instead. In the Project Settings > XR > OpenXR you can select the runtime, if oculus is in that list select that.

    2) Make sure `Lock Input to Game View` is checked in the input debugger. Open the input debugger using (Windows > Analysis > Input Debugger) in the input debugger choose (Options > Lock Input To Game View)

    3) When running in play mode you can also look in the input debugger under devices and see if the controllers are showing up.

    4) If none of that works if you could package up your project (sans the library folder) and send it we can take a look and see what is going on.
     
  6. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    I will do all of that and get back to you. One question: What package do I need to install in order to have the oculus runtime show up in the OpenXR settings? It might already be there, but I won't be at that computer for a while, so I want to be prepared in case that setting is available and I have not installed the right package. Currently the only package installed is the OpenXR and then the other basic stuff.
     
  7. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    It will show up in the list under (Project Settings > XR > OpenXR : OpenXR Runtime (Editor Instance Only)) if you have the oculus desktop app installed in the default location.

    With OpenXR your machine has a single default runtime that it will use. In this case you are using the SteamVR runtime (which should still work) but you can temporarily bypass that runtime to use the Oculus runtime with that option. You can also switch your system to the Oculus runtime in the Oculus desktop app options I believe.
     
  8. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    Ok. I will give that a try. Thank you. If it all fails I have just barely started this project, so I will be able to zip it up and send it if needed. I have learned to make sure everything is working in the VR setup before moving forward with actual game dev.
     
  9. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    I tried changing the runtime engine. System Default brings up SteamVR. Oculus I have to have Oculus app running on the PC and have link connected before I start it.

    Either one gives the same results. The head tracking works fine, but both controllers don't work. I just see the red laser lines on the ground.

    I have attached the project.
     

    Attached Files:

  10. d-3

    d-3

    Joined:
    Oct 18, 2009
    Posts:
    213
    Having the same issue here, tried other bindings and it's not work.
    I think for now it's better user the old xr rig.
    Also Noticed that the game view need to be in focus for input system works, other wise they stop tracking the hmd!
    unity 2020.2.0f1
     
  11. JoTsc

    JoTsc

    Joined:
    Jul 18, 2019
    Posts:
    1
    Same issue as described above. Quest 2
     
  12. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    So the question for me is can this be fixed? Obviously we want OpenXR to work. Is this a problem in the OpenXR for Unity or OpenXR in SteamVR or Oculus or what?

    I would really like to use the latest stuff so I don't have to switch it all out when I am deep into my project.

    If this will take a while (more than a few weeks) to fix, what can everyone recommend I use? What version of Unity and what exact configuration for everything? My target is first SteamVR and then Quest native in that order of priority...
     
  13. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Sorry I didnt get a chance to look at this over the weekend. I found the issue in your project. If you click on the XRRig there is a component called `Input Action Manager`. Add an element to "Action Assets" list and choose the "XRI Default Input Actions" action asset. Once I did this everything seemed to be working.

    I took at look at that script as I was not familiar with it myself and what it does is enable all the actions in that action asset. So basically because nothing was specified there there were no enabled actions so the controllers didnt respond.

    This is unrelated to OpenXR.
     
  14. d-3

    d-3

    Joined:
    Oct 18, 2009
    Posts:
    213
    This Solved my problem.. but I'm not using OpenXR on this project, but should work

    upload_2021-1-25_20-8-0.png
     
  15. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    How did you create the rig for your project?
     
  16. d-3

    d-3

    Joined:
    Oct 18, 2009
    Posts:
    213
    Create a normal XR Rig action based and add a component Input Action Manager and feed the XRI default input actions
     
  17. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Ok so you added it to your XRRig. When I was trying to figure out the solution I couldnt find a XRRig that had that component on it. I believe the XRController should be enabling those actions though, I will talk to the XRI team to confirm.
     
  18. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Checked with the XRI team. It looks like if XRController has non-reference actions specified then it will automatically enable those actions but if they are reference actions then they need to be enabled using something such as the InputActionManager. Hope that helps!
     
    d-3 likes this.
  19. d-3

    d-3

    Joined:
    Oct 18, 2009
    Posts:
    213
    Thank you, so basically if we create and not reference the action or set as Default, it will work right out of the box?!

    but if we reference to the controllers or set a default like this
    upload_2021-1-25_21-26-22.png

    upload_2021-1-25_21-23-17.png
    then we need the InputActionManager?
     
  20. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    In the XRController the "Use Reference" checkbox will require the actions to be enabled, if you embed an action in there (no reference) then it will auto-enable.

    upload_2021-1-25_15-58-4.png
     
    d-3 likes this.
  21. d-3

    d-3

    Joined:
    Oct 18, 2009
    Posts:
    213
    Cool, Thanks for the clarification!
     
  22. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    That solved it for me too. Thanks!!!

    The weird thing is that step is at the end of that video I referenced and I specifically remember doing that step. I have no idea how it ended up not getting done.

    Maybe it was the second time that I had done the project I just forgot.

    I had to start the project over from scratch because I had originally created it with other frameworks and packages and it was all messed up. As I think about it I am pretty sure I just forgot to do it the second time.

    Sorry to make such a dumb mistake. Thanks for finding it.
     
  23. krishnapriyachoudoor

    krishnapriyachoudoor

    Joined:
    Jun 2, 2021
    Posts:
    8
    I have followed all the suggestions in this post and I still cannot get the controllers working. I am using Oculus Quest 2 and OpenXR. I linked the default input actions and have all the settings right. Am I missing anything ?
     
  24. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Are your actions enabled?
     
  25. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Also try checking the input debugger "Window -> Analysis -> Input Debugger" and open the openxr devices (if they are there, if not then thats a problem) and see if data is flowing
     
  26. krishnapriyachoudoor

    krishnapriyachoudoor

    Joined:
    Jun 2, 2021
    Posts:
    8
    I checked the input devices and I did not find openXR devices. And what do you mean by data flowing ?
     
  27. krishnapriyachoudoor

    krishnapriyachoudoor

    Joined:
    Jun 2, 2021
    Posts:
    8
    Do you mean the "Enable input actions" check box in the XRControllers ? If yes, it is checked to true.
     
  28. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    In the input debugger if you double click on the controller device it should show you the data for all of the device controls. Check to see if data is coming in on those controls or not.

    Otherwise for us to debug any further we would need a sample project (or your project) that demonstrates the issue. You can submit this as a bug through `Help -> Report A Bug` and include the project. If you do please post your issue # here so we can take a look.
     
  29. krishnapriyachoudoor

    krishnapriyachoudoor

    Joined:
    Jun 2, 2021
    Posts:
    8
    Thank you for your quick responses. I used SteamVR to connect my Quest 2 to my laptop and tried opening my game. The controllers are being tracked now. However, I see these red and green grid lines in the play mode. Is this expected or did I miss anything while configuring the whole Rig setup ?
    Capture.PNG
     
  30. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    It looks like you have gizmos turned on in game view, the gizmo button in the top right to turn them off.
     
  31. krishnapriyachoudoor

    krishnapriyachoudoor

    Joined:
    Jun 2, 2021
    Posts:
    8
    Yes, all looks good when turned off. I am a beginner to Unity and still exploring. Thanks a lot for your help :)
     
    the_real_apoxol likes this.
  32. IvanTheTankable

    IvanTheTankable

    Joined:
    Apr 22, 2021
    Posts:
    15
    I am still having the problem described in this thread. I verified that input is being received correctly and I believe I have my objects and settings set up correctly, but I still can't walk around, move my hands, interact etc. I have attached a replication of the scene I was working with (I am not at liberty to share the larger project), but this scene should encompass my problem.
    https://drive.google.com/file/d/1a2jjxme8TpN_Kql7FszLd_c3vYHogYGf/view?usp=sharing
     
    jy603 likes this.
  33. TJoE70

    TJoE70

    Joined:
    May 15, 2020
    Posts:
    6
  34. ASquareDevs

    ASquareDevs

    Joined:
    Jun 2, 2021
    Posts:
    5
    Has this issue been addressed? I've tried downgrading/upgrading to some of the versions suggested above, but to no luck. Currently working in 2021.3.7f1
     
  35. Hotshot10101

    Hotshot10101

    Joined:
    Jun 23, 2012
    Posts:
    223
    It has been so long since I messed with this. I think I just took a totally different approach and am using the HurricaneVR assets. They work awesome!