First Person Controller not found by GameObject.find()

So I have some code that was working in Unity 4.5x and I recently moved to Unity 5 the error I am getting is NullReferenceException: Object reference not set to an instance of an object Menu.Update () (at Assets/Scripts/Player/Menu.cs:33).

I am unsure what I am doing wrong or how the API changed that is preventing me from unlocking the mouse and locking mouse look like I used to is there a new way to do this? Do I need to remove the first person controller or something?

I have the following code:

using UnityEngine;
using System.Collections;


public class Menu : MonoBehaviour 
{
	bool inMenu;
	public Canvas InGameMenu;
	public Canvas Options;

	// Use this for initialization
	void Start () 
	{
		inMenu = false;
		Screen.lockCursor = true;
	}
	
	// Update is called once per frame
	void Update () 
	{
		if (Input.GetKeyUp(KeyCode.Escape))
		{
			if(InGameMenu.enabled || Options.enabled)
			{
				Screen.lockCursor = true;
				GameObject.Find("First Person Controller").GetComponent<MouseLook>().enabled = true;
				GameObject.Find("Main Camera").GetComponent<MouseLook>().enabled = true;
				InGameMenu.enabled = false;
				Options.enabled = false;
			}else
			{
				InGameMenu.enabled = true;
				GameObject.Find("Main Camera").GetComponent<MouseLook>().enabled = false;    //line 33 error here
				GameObject.Find("First Person Controller").GetComponent<MouseLook>().enabled = false;
				Screen.lockCursor = false;
			}
		}
	}
}

I recently had something similar to this, and what’s happening here is that you are not simply grabbing a reference via Find, but then doing a combo with .enabled = true (or false); there are some subtleties about changing parameters or components associated to Standard Assets. A simple fix is to move this script into the Standard Assets folder. You can find more info here: