I put this code in to make the camera rotate and for some reason, the camera only rotates on the x-axis not the y why is this
code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class camerarotate : MonoBehaviour
{
private float mouseX;
private float mouseY;
// Start is called before the first frame update
void Start()
{
Screen.lockCursor = true;
}
// Update is called once per frame
void Update()
{
mouseX += Input.GetAxisRaw("Mouse X");
mouseY += Input.GetAxisRaw("Mouse Y");
transform.localRotation = Quaternion.Euler(Vector3.right * mouseY);
transform.localRotation = Quaternion.Euler(Vector3.up * mouseX);
}
}