title: Unity: camera falls through terrain
body: <p>Problem is:</p>
  
  <p>I have created terrain and I need to fly over terrain with Camera. I added to Camera "Mouse Look" script, RigidBody: usegravity - unchecked and I have added my code in Update method:</p>
  
  <pre><code>    float vert = Input.GetAxis("Vertical");
      float hor = Input.GetAxis("Horizontal");
  
      if (vert != 0)
      {
          if (!Physics.Raycast(this.transform.position, this.transform.forward, 5))
          {
              transform.Translate(Vector3.forward * flySpeed * vert);
          }
          else
          {
              transform.Translate(Vector3.up * flySpeed * vert);
          }
      }
  
      if (hor != 0)
      {   
  
          if (!Physics.Raycast(this.transform.position, this.transform.forward, 5))
          {
              transform.Translate(Vector3.right * flySpeed * hor);
          }
          else
          {
              transform.Translate(Vector3.up * flySpeed* hor);
          }
      }
  
      if (Input.GetKey(KeyCode.E))
      {
          transform.Translate(Vector3.up * flySpeed);            
      }
      else if (Input.GetKey(KeyCode.Q))
      {
          Vector3 v = Vector3.down * flySpeed;
  
          if (!Physics.Raycast(this.transform.position, this.transform.forward, 5))
          {
              transform.Translate(v);
          }           
      }
  </code></pre>
  
  <p>But sometimes then i go down - Q - camera goes through terrain. Why? 
  Also looks ugly if you are moving with camera forward as low as possible over terrain and camera does not fall through it - it starts to jump. Also why?</p>