title: Unity problem with creating my own fps controller
body: <p>So I'm making a first person player controller for my game, but I have one small problem. My code works fine until I rotate 180 degrees with my camera, then the movement gets inverted.</p>
  <p>Some variable declarations:</p>
  <ul>
  <li>horizontal is the &quot;Horizontal&quot; axis</li>
  <li>vertical is the &quot;Vertical&quot; axis</li>
  </ul>
  <p>My code:</p>
  <pre><code>gameObject.transform.Translate((playerCamera.transform.right * horizontal).x * Time.deltaTime * speed, 
              0f, (playerCamera.transform.forward * vertical).z * Time.deltaTime * speed);
  </code></pre>
  <p>The first person camera works fine.</p>
  <p>Edit:
  I switched to character controller and now it works.</p>