title: Disabling head-tracking on a SteamVR camera in Unity?
body: <p>I am trying to develop a HUD for my VR players using two cameras. One is a <strong>stationary</strong> camera that points at my HUD objects with a depth=1, the other is the main camera with depth=0 which tracks the HMD and has the HUD overlaid onto it.</p>
  
  <p>However Unity, SteamVR or OpenVR is forcing my camera to track the player's HMD. After my exhaustive search I was unable to find any way to stop this behavior. Then I tried to parent all of my HUD objects to my HUD camera and hoped for the best.</p>
  
  <p>This results in undesirable jerky motion in all HUD objects:</p>
  
  <p><em>Project Hierarchy:</em></p>
  
  <pre><code>[WorldHUD]
      |__ Container (HUD) 
          |__ Camera (eye)
              |__ TextMesh (Status) &lt;- Is child of camera
  
  [CameraRig]
      |__ Camera (Head) 
          |__ Camera (eye)
  
  [SteamVR]
  </code></pre>
  
  <p>I believe I really need control over my camera's transform so I may prevent it from moving or stopping it from tracking the player's HMD.</p>
  
  <p>I have tried updating the cameras position in <code>Update()</code> and <code>LateUpdate()</code> but that does not have any affect. I also spent many hours modifying/debugging SteamVR and OVR scripts which had no positive results and the cameras never stopped tracking.</p>
  
  <p>I have tried using <a href="https://forum.unity3d.com/threads/completely-disable-position-tracking.450644/#post-291813" rel="nofollow noreferrer">this suggested script</a> on my cameras parent:</p>
  
  <p><em>NegateTracking.cs:</em></p>
  
  <pre class="lang-c# prettyprint-override"><code>using UnityEngine;
  using UnityEngine.VR;
  
  public class NegateTracking : MonoBehaviour
  {
      void LateUpdate()
      {
          transform.position = -InputTracking.GetLocalPosition(VRNode.CenterEye);
          transform.rotation = Quaternion.Inverse(InputTracking.GetLocalRotation(VRNode.CenterEye));
      }
  }
  </code></pre>
  
  <p>This caused the camera to point in one direction but was still translating a bit. However I noticed that things seemed even more choppy this way and feel I'm either using it wrong or it just isn't sufficient.</p>
  
  <p>I'm now back to looking for ways to disable headtracking on certain cameras so I am able to position them in my scene.</p>
  
  <p>Does anyone know how SteamVR/OpenVR takes control of these camera's transforms? Is there any way to disable or overridden this behavior?</p>
  
  <p>Thank you.</p>