Make Pausing Lock "Camera" (JAVASCRIPT)

I basically want to make it so whenever I press Escape it will make it so the camera does not move… I have this and I want to add on to it basically. I don’t know how to use Vectors or Transforms very well so if you can also explain with the // function that’d be perfect, thanks in advance!

My pause code:

 #pragma strict
 
 private var paused: boolean = false; //variable for detect state game pause/unpause
 
 function Update() {
  //Best use KeyCode
  if(Input.GetKeyDown(KeyCode.Escape)) {
   if(paused) {
    Time.timeScale = 1;
    paused = false;
   } else {
    Time.timeScale = 0;
    paused = true;
   }
  }
 }

You can temporarily disable MouseLook whenever you pause the game. Since you’re using the First Person Controller, there will be two MouseLook scripts to disable: One on the body and another on the camera. You’ll have to keep a reference to them in your pause code.

public var mouseLookX : MouseLook; //Body
public var mouseLookY : MouseLook; //Camera

Just drag the objects with the MouseLook component in the proper slot. Then you use these lines:

//when pausing the game
mouseLookX.enabled = false;
mouseLookY.enabled = false;

//when resuming the game
mouseLookX.enabled = true;
mouseLookY.enabled = true;