GameControl always null?

Hi, I don’t know what is wrong with my destroy portion of the below code. I’m trying to have only 1 GameControl persist throughout the scenes. It seems that every time I switch back to this scene, my GameControl is read as null and a new GameControl is generated and I end up having more than 1 GameControl persisting.

For reference: I tried to port the code from 18:24 to JavaScript from this - YouTube

Please advise.

#pragma strict

var control : GameControl;

function Awake () {
Debug.Log("GameControl runs");

	if (control == null)
	{
		DontDestroyOnLoad(gameObject);
		control = this;
		Debug.Log(control);
	} else if (control != this)
	{
		Destroy(gameObject);
		Debug.Log("Destroy?");
	}
}

function Update () {

}

I had to initiate the GameControl as “static var control : GameControl;” so that the value can persist throughout all scenes rather than recreate itself each time with the referenced value in the script.