I am really new to coding and made this code to rotate my camera around the player object but I do not know how I would proceed to clamp the rotation on the X axis.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FollowPlayer : MonoBehaviour
{
public float speed;
public Transform target;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.RotateAround(target.position, transform.right, -Input.GetAxis("Mouse Y") * speed);
transform.RotateAround(target.position, Vector3.up, -Input.GetAxis("Mouse X") * speed);
}
}
This is my code to rotate the camera, I want to clamp the Mouse Y one.