"unity fps camera rotation script" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "unity fps camera rotation script" answered properly. Developers are finding an appropriate answer about unity fps camera rotation script related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like unity fps camera rotation script. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on unity fps camera rotation script.
unity fps camera rotation script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class mouselook : MonoBehaviour
{
public float mouseSensitivity = 100f;
public Transform playerBody;
float xRotation = 0f;
void Start()
{
Cursor.lockState = CursorLockMode.Locked;
}
void Update()
{
float mouseX = Input.GetAxis("Mouse X") * mouseSensitivity * Time.deltaTime;
float mouseY = Input.GetAxis("Mouse Y") * mouseSensitivity * Time.deltaTime;
xRotation -= mouseY;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);
playerBody.Rotate(Vector3.up * mouseX);
}
}
All those coders who are working on the Whatever based application and are stuck on unity fps camera rotation script can get a collection of related answers to their query. Programmers need to enter their query on unity fps camera rotation script related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about unity fps camera rotation script for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of unity fps camera rotation script while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "unity fps camera rotation script". Visit this developer's friendly online web community, CodeProZone, and get your queries like unity fps camera rotation script resolved professionally and stay updated to the latest Whatever updates.