Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
amit_dror_93's avatar
amit_dror_93
Honored Guest
5 years ago

What is the moving part of the OVRPlayercontroller prefab

I need to measure the distance from the HMD to an object in the scene.
I used all relevant objects in the prefab as the target but in the logcat I could see that no matter which object I choose non actually moved in unity.
The guardian was in stationary mode but had the same problem when not.

    public Transform head;
    private StreamWriter writer;
    public Rigidbody fixedpoint;
    private float time = 0.0f;
    public float interpolationPeriod = 1f;
    private UnityEngine.Camera FOV;

    void Awake()
    {
        Debug.Log(getPathToCSV());
        FOV = UnityEngine.Camera.main;
    }

    //-------------------------------------------------
    void FixedUpdate()
    { 
        time += Time.deltaTime;
        if (time >= interpolationPeriod)
        {
            time = 0.0f;
            //prints time, distance between fixpoint and HMD and boolean if the object is visable
            Debug.Log(DateTime.Now.ToString() + " , " + Vector3.Distance(fixedpoint.position, transform.position).ToString() + "," + IsVisable());
            Debug.Log("HMD Position: "+this.transform.position);
        }
    }
}



in logcat :
2020-08-10T17:45:14.182Z:info14546/14532 Unity
HMD Position: (-1.5, 1.8, 3.7)
2020-08-10T17:45:15.212Z:info14546/14532 Unity
HMD Position: (-1.5, 1.8, 3.7) <br
2020-08-10T17:45:18.261Z:info14546/14532 Unity
HMD Position: (-1.5, 1.8, 3.7)


So in short what part of the OVRcontroller prefab actually moves in the scene like the player?

2 Replies

Replies have been turned off for this discussion
  • The head anchor gameobject inside of ovrCameraRig is what you need to track

  • Thanks MikeF,
    Do you mean the trackerAnchor? these are all the options in the prefab.