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 have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Problem detecting quest 2 touch controllers in a project

Discussion in 'VR' started by Reaper77713, Nov 6, 2022.

  1. Reaper77713

    Reaper77713

    Joined:
    Jul 6, 2021
    Posts:
    6
    Hello everyone,
    After setting up a basic VR project to test out the headset and touch controllers, I found out that the headset is working fine but there's no movement in both the controllers. Snap turning seems to be working fine but it doesn't track when I move the controllers in any direction. I wrote a simple code to check if unity is even detecting the controllers or not. Like I thought, unity doesn't detect the touch controllers no matter what I do but surprisingly like I said, snap turning was still working with the analog sticks. I've seen a lot of people pointing out that their input tracking turned off when entering playmode and I checked that and don't have any problems there as well. Any idea what might be causing this issue? I've attached the screenshots of the code and console.
    Thanks in advance! Code.jpg
    Console.jpg
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    How is your project setup?
    What plugins etc are used for VR
     
  3. Reaper77713

    Reaper77713

    Joined:
    Jul 6, 2021
    Posts:
    6
    Basically I just put a plane as ground and an XR origin(VR), I've attached an image to show that. I've tried using both oculus and openXR plugin but it doesn't detect the controllers in either of them. OpenXR Problem.jpg
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    Did you add models to the controller anchors. Do you see the anchors gameobjects moving in the scene view?
     
  5. Reaper77713

    Reaper77713

    Joined:
    Jul 6, 2021
    Posts:
    6
    Yeah I added cubes as model to the controller anchor and as you can see in the above image, they are there at the centre of the plane. And no, they aren't moving in the scene view as well
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    Which scripts are used for the controller tracking
     
  7. Reaper77713

    Reaper77713

    Joined:
    Jul 6, 2021
    Posts:
    6
    The hand presence script that I attached in my question above
     
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,455
    Then there is nothing moving the controller, right?
     
  9. Reaper77713

    Reaper77713

    Joined:
    Jul 6, 2021
    Posts:
    6
    The XR Origin is moving the controller, hand presence script is being used to track whether the controllers are present or not