How to get camera to stop rotating when game is paused?

Basically, I’m trying to make a note read script and when the note appears on screen I want the game to pause. I’ve got most of it to work the problem is that the player can still look around the scene when in this pause mode. I want it to be so that they can’t rotate the camera when this happens. I don’t know if it’s my code or if I’m missing code but here’s my script if someone can please explain this to me it would be very appreciated.

public class NoteRead : MonoBehaviour
{
public GameObject notePanel;
public GameObject noteObject;
public GameObject timeText;
public GameObject crosshair;
public GameObject crosshairSelected;

public RaycastHit hit;

public LayerMask noteLayer;

void Start()
{
    notePanel.SetActive(false);
}


void Update()
{
    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    Debug.DrawLine(ray.origin, hit.point);

    if (Physics.Raycast(ray, out hit, 10, noteLayer))
    {
        if (Input.GetKeyDown(KeyCode.E))
        {
            notePanel.SetActive(true);
            timeText.SetActive(false);
            crosshair.SetActive(false);
            crosshairSelected.SetActive(false);
        }

        crosshair.SetActive(false);
        crosshairSelected.SetActive(true);
    }

    if(!Physics.Raycast(ray, out hit, 10, noteLayer))
    {
        crosshair.SetActive(true);
        crosshairSelected.SetActive(false);
    }

    if(notePanel.activeInHierarchy)
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            notePanel.SetActive(false);
            timeText.SetActive(true);
            crosshair.SetActive(true);
        }

        crosshair.SetActive(false);
        crosshairSelected.SetActive(false);
    }

    if(notePanel.activeInHierarchy)
    {
        PauseGame();
    }
    else
    {
        ResumeGame();
    }
}

void PauseGame()
{
    Time.timeScale = 0f;
}

void ResumeGame()
{
    Time.timeScale = 1f;
}

}

@unity_FsgZeezP8O3S_w
That depending on how you design your game. If your camera rotation is based on Time.deltaTime, setting the time scale to zero will pause the rotation. If not, then you need more complex code to make it work. Try using the public enum to set it as run or pause in the void Update().