Rotate First Person Freecam with Right-Click

I’m making a first person freecam for my game but i cant figure out how to rotate it. my idea is to hold right click to rotate it around itself
here’s my current code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FreeCam : MonoBehaviour
{
    void Update()
    {
        if (Input.GetKey(KeyCode.W))
        {
            gameObject.transform.position += transform.forward * 0.01f;
        }
        if (Input.GetKey(KeyCode.S))
        {
            gameObject.transform.position -= transform.forward * 0.01f;
        }
        if (Input.GetKey(KeyCode.E))
        {
            gameObject.transform.position += transform.up * 0.01f;
        }
        if (Input.GetKey(KeyCode.Q))
        {
            gameObject.transform.position -= transform.up * 0.01f;
        }
        if (Input.GetKey(KeyCode.A))
        {
            gameObject.transform.position -= transform.right * 0.01f;
        }
        if (Input.GetKey(KeyCode.D))
        {
            gameObject.transform.position += transform.right * 0.01f;
        }
    }
}

put the code under the camera btw

In your script use either vector3 or Quaternion.Slerp and set the rotation speed to a constant like 1.5 or 2 or something. You can just correct the code for the getinputaxis for the right click event or even generate the whole script from gpts’ , just mention your requirements briefly. Hope it helps.