cancel
Showing results for 
Search instead for 
Did you mean: 

What is the moving part of the OVRPlayercontroller prefab

amit_dror_93
Honored Guest
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 2

MikeF
Trustee
The head anchor gameobject inside of ovrCameraRig is what you need to track

amit_dror_93
Honored Guest
wa30yzv1b90h.png
Thanks MikeF,
Do you mean the trackerAnchor? these are all the options in the prefab.