Wird error in consol

I accidently deleted my script that lock camera on object after pressing button. I restore it back from Trash folder and now it keep saying in console(bottom panel in Unity) that “NullReferenceException: Object reference not set to an instance of an object”. And at line 21 in script showhideobject.js. This is the script:

   var other : GameObject;
var Sound : AudioClip;
private var fpcMouse;
private var camMouse;

function Start () {
	fpcMouse = gameObject.Find("First Person Controller").GetComponent("MouseLook"); 
	camMouse = gameObject.Find("Main Camera").GetComponent("Cameralock");
	renderer.enabled = false;
}


   function Update() {
     
        if (Input.GetKeyDown(KeyCode.F)) {
            // toggle visibility:
			canMove = false;
			audio.PlayOneShot(Sound);
            renderer.enabled = !renderer.enabled;
			fpcMouse.enabled = !fpcMouse.enabled;
			camMouse.enabled = !camMouse.enabled;

	    }
}

and cameralock.js script:

var target : Transform; 

function Update() {
    transform.LookAt(target);
}

Now the cameralock script is turned on at game start, but before it wasnt. And line 21 in showhideobject script is:

camMouse.enabled = !camMouse.enabled;

From what I can see, camMouse would be null if the GetComponent call on line 8 failed. The most likely reason for this would be that the name isn’t exactly the same as the name of the script (including upper/lower case). If this doesn’t solve it then check that there actually is an instance of the Cameralock.js script attached to the object.

I changed “GetComponent(“Cameralock”);” to “GetComponent(“cameralock”);” and for now error not shows up but camera is locked from start. How to disable cameralock script at game start? I tryed at function start the “camMouse.enabled = false;” in showhideobject.js but camera lock will not work after pressing F.

EDIT: After restarting Unity it works good Oo