I have some basic code that lets you look around but it lets you rotate all the way upside down I want it to still be able to rotate up and left and right though.
Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraMove : MonoBehaviour
{
public float SpeedH = 2.0f;
public float SpeedV = 2.0f;
private float yaw = 0.0f;
private float pitch = 0.0f;
private void Start()
{
Cursor.visible = false;
}
void Update()
{
yaw += SpeedH * Input.GetAxis("Mouse X");
pitch -= SpeedV * Input.GetAxis("Mouse Y");
transform.eulerAngles = new Vector3(pitch, yaw, 0.0f);
}
}