c# unity rotate first person controller script

C#
 public class myFPSBehavior : MonoBehaviour {
     public float rotationSpeed = 10.0F;
     
     void FixedUpdate()
     {
         if (Input.GetKey("escape"))
             Application.Quit();
 
         float rotation = Input.GetAxis("Rotate") * rotationSpeed;
   
         rotation *= Time.deltaTime;
 
         transform.Rotate(0, rotation, 0);
     }
 }


Source

Also in C#: