Search Unity

Question XR Controller gets wrong position (HTC Vive)

Discussion in 'AR/VR (XR) Discussion' started by jesper300595, May 28, 2020.

  1. jesper300595

    jesper300595

    Joined:
    May 28, 2020
    Posts:
    1
    Hello. So this is my first time laying hands on Unity, actually first time working with a game engine.

    I follow a tutorial on youtube to get started and can't seem to get the correct tracking of my controllers.

    I've created an empty game object and added the component XR Rig

    upload_2020-5-28_23-28-34.png

    As seen on the image above, I've put on the Camera Offset and a Camera

    upload_2020-5-28_23-29-32.png
    upload_2020-5-28_23-29-53.png

    I have then created two empty game objects under my VR Camera, a right hand and a left hand. Both of those I've added the XR Controller and set the Controller Node to left hand / right hand.

    upload_2020-5-28_23-31-31.png

    But when I press play, the controllers seem to be floating a lot higher than the headset and the tracking is completely off.
    upload_2020-5-28_23-33-15.png

    I hope someone can tell me what I'm doing wrong, if more information is needed please let me know.

    P.S. I've under Project settings -> Player, added OpenVR
     
  2. MaxC24

    MaxC24

    Joined:
    Apr 7, 2017
    Posts:
    1
    I have the same issue, were you ever able to figure this out?
     
  3. flomaaa

    flomaaa

    Joined:
    Apr 12, 2019
    Posts:
    24
    Same issue since this afternoon. Did you find the problem, Max?
     
  4. darthslayer504

    darthslayer504

    Joined:
    Mar 31, 2021
    Posts:
    1
    I have the same issue
    i followed this tutorial
     
  5. Lenvanthis012

    Lenvanthis012

    Joined:
    Aug 24, 2013
    Posts:
    21
    I found the issue. When you create the controller prefab, make sure that the position of the prefab is (0,0,0). For me, it wasn't set that way, hence the persistent offset. Hope this helps others!
     
    Elizaveta_U likes this.
  6. nilagard

    nilagard

    Joined:
    Jan 13, 2017
    Posts:
    77
    Oh boy! First of all I am super stoked that you are in Unity, and for the first time! Second of all, VR is WAY more complicated to operate than anything else. #1, learn Unity's core features and how the game engine works before anything else, aka read read read and experiment with the documentation. #2, create small and fun little things to make yourself better, #3, if you don't already know how to code, work on that. After you've become some kind of proficient and feel like you grasp things THEN you can jump on to VR. Your journey is just begninning, this is going to be so fun for you if you are willing to scale your obstacles!