Search Unity

Left and Right arrow to turn

Discussion in 'Scripting' started by GizmoBradwell, Apr 16, 2012.

  1. GizmoBradwell

    GizmoBradwell

    Joined:
    Dec 27, 2010
    Posts:
    67
    Hi there,

    How do I create a script that can rotate X on delta time my fps capsule (the parent of the main camera) that can take the left and right arrow keys input, thus having them spin my view accordingly? Also would be useful to have sensitivity variable exposed!

    Thanks fro the help! :)
     
  2. Morning

    Morning

    Joined:
    Feb 4, 2012
    Posts:
    1,141
    Code (csharp):
    1. transform.Rotate(Vector3.right * Time.deltaTime);