Example #1
0
    // Update is called once per frame
    private void Update()
    {
        rotX -= Input.GetAxis("Mouse Y") * lookSpeed;
        rotY += Input.GetAxis("Mouse X") * lookSpeed;

        rotX = Mathf.Clamp(rotX, -85, 85);

        Quaternion localRotation = Quaternion.Euler(rotX, rotY, 0.0f);

        transform.rotation = localRotation;

        fpsPlayer.SetPlayerRotation(transform.rotation);
    }