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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How can I disable the positional tracking in Unity 5.4.0p4 for VR devices?

Discussion in 'AR/VR (XR) Discussion' started by Klaus-Eiperle, Sep 5, 2016.

  1. Klaus-Eiperle

    Klaus-Eiperle

    Joined:
    Mar 10, 2012
    Posts:
    41
    Hi,

    I'm on Unity 5.4.0p4 and need to disable the positional tracking for the camera. I need only the rotational tracking.

    In previous Unity3D versions I used the OVR implementation and moved the camera game object to the center:
    void FixedUpdate() {
    myCamera.transform.position = new Vector3 (0,0,0);
    }

    And now with the Unity VR implementation, I placed the camera into an empty game object (myCameraRig) and moved this:
    myCameraRig.transform.position = new Vector3 (-myCamera.transform.position.x, -myCamera.transform.position.y, -myCamera.transform.position.z);

    But then one eye will be rendered with the position from the head tracking system and one eye is rendered with the centered camera position.

    Any suggestions?
     
  2. rexxthunder

    rexxthunder

    Joined:
    Aug 25, 2012
    Posts:
    35
    I had the same issue. The easiest solution I found was the parent the camera to a empty GameObject then scale the GameObject to 0,0,0. Oddly enough, it works great!
     
    Klaus-Eiperle likes this.
  3. Klaus-Eiperle

    Klaus-Eiperle

    Joined:
    Mar 10, 2012
    Posts:
    41
    Thank you very much. This is working for me. You are genius!
     
  4. Peter-Bickhofe

    Peter-Bickhofe

    Joined:
    Aug 31, 2014
    Posts:
    8
    I have to thank u, too! Great hack! Thx!