title: How do I use SteamVR_LoadLevel to fade between scenes in unity3d?
body: <p>I've got this at the top,</p>
  
  <pre><code>    public GameObject mainCamera
  </code></pre>
  
  <p>and then I've got this within an if statement,</p>
  
  <pre><code>    SteamVR_LoadLevel tempload = mainCamera.GetComponent&lt;SteamVR_LoadLevel&gt;();
      tempload.fadeOutTime = 1f;
      tempload.fadeInTime = 1f;
      tempload.Trigger();
  </code></pre>
  
  <p>but I'm getting this error when triggering the if statement, </p>
  
  <p><strong>Coroutine 'LoadLevel' couldn't be started because the the game object 'Camera (head)' is inactive!</strong></p>
  
  <p>Edit 1. I figured it out, I should have made the mainCamera variable of type SteamVR_Camera and I should have nullchecked it as well as tested for it being active and enabled.</p>