It looks like you're new here. If you want to get involved, click one of these buttons!
I am currently doing the mouse look script and have finished by my character can only look up and down. I am sheiße at coding so be gentle. Here is my code.
public class MouseLook : MonoBehaviour
public float mouseSensitivity = 100f;
public Transform playerBody;
float xRotation = 0f;
// Start is called before the first frame update
Cursor.lockState = CursorLockMode.Locked;
// Update is called once per frame
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);