Search Unity

XR Only head rotation working

Discussion in 'VR' started by WireWhiz, Aug 18, 2020.

  1. WireWhiz

    WireWhiz

    Joined:
    Apr 17, 2019
    Posts:
    16
    Hey everyone, I've been working on a multiplayer game and I have been sending builds to a friend with a WMR headset to test them. The problem is that for some reason the only part of 6dof tracking working is the head rotation. My builds work just fine when I build it to my quest and pc (using link). The last build I sent him was built using 2019.4.6f1 and the platform was set for PC, Mac & Linux Standalone. The build would open in VR but he was only able to look around with no movement, controller inputs worked too. This is the code I'm using to get positions:
    Code (CSharp):
    1. var heads = new List<UnityEngine.XR.InputDevice>();
    2.         UnityEngine.XR.InputDevices.GetDevicesAtXRNode(UnityEngine.XR.XRNode.Head, heads);
    3.         var leftHandDevices = new List<UnityEngine.XR.InputDevice>();
    4.         UnityEngine.XR.InputDevices.GetDevicesAtXRNode(UnityEngine.XR.XRNode.LeftHand, leftHandDevices);
    5.         var rightHandDevices = new List<UnityEngine.XR.InputDevice>();
    6.         UnityEngine.XR.InputDevices.GetDevicesAtXRNode(UnityEngine.XR.XRNode.RightHand, rightHandDevices);
    7.  
    8.         UnityEngine.XR.InputDevice head = new UnityEngine.XR.InputDevice();
    9.         if (heads.Count == 1)
    10.         {
    11.             head = heads[0];
    12.         }
    13.  
    14.         UnityEngine.XR.InputDevice leftHand = new UnityEngine.XR.InputDevice();
    15.         if (leftHandDevices.Count == 1)
    16.         {
    17.             leftHand = leftHandDevices[0];
    18.         }
    19.  
    20.         UnityEngine.XR.InputDevice rightHand = new UnityEngine.XR.InputDevice();
    21.         if (rightHandDevices.Count == 1)
    22.         {
    23.             rightHand = rightHandDevices[0];
    24.         }
    25.  
    26.         head.TryGetFeatureValue(UnityEngine.XR.CommonUsages.devicePosition, out Vector3 headPosition);
    27.         head.TryGetFeatureValue(UnityEngine.XR.CommonUsages.deviceRotation, out Quaternion headRotation);
    28.         leftHand.TryGetFeatureValue(UnityEngine.XR.CommonUsages.devicePosition, out Vector3 leftPosition);
    29.         leftHand.TryGetFeatureValue(UnityEngine.XR.CommonUsages.deviceRotation, out Quaternion leftRotation);
    30.         rightHand.TryGetFeatureValue(UnityEngine.XR.CommonUsages.devicePosition, out Vector3 rightPosition);
    31.         rightHand.TryGetFeatureValue(UnityEngine.XR.CommonUsages.deviceRotation, out Quaternion rightRotation);
    I've also tried legacy code:
    Code (CSharp):
    1. PoseDataSource.GetDataFromSource(TrackedPoseDriver.TrackedPose.Center, out Pose head);
    2.         PoseDataSource.GetDataFromSource(TrackedPoseDriver.TrackedPose.LeftPose, out Pose leftHand);
    3.         PoseDataSource.GetDataFromSource(TrackedPoseDriver.TrackedPose.RightPose, out Pose rightHand);
    Anyone have any ideas? Could It just be that I need to build for UWP? If I need to build for UWP why does the genaric build still halfway work?
     
  2. Deleted User

    Deleted User

    Guest

    What glasses did you use during development? It may be worth trying to make a project for PC in Unity 2020.
     
  3. WireWhiz

    WireWhiz

    Joined:
    Apr 17, 2019
    Posts:
    16
    A dell mixed reality headset, I tried using 2020 but it's too unstable for my needs currently as I was unable to build for android with it.