Ok, so with some serious researching and trying to change the way I’ve been doing things for seven months now. I think I’ve figured out a solution. Here is the revised code without error.
private var tempComp : CentralSavingScript;
//
function Awake() {
infoComp = Camera.main.GetComponent(CentralSavingScript) as CentralSavingScript;
infoComp.PlayerInfo();
}
No exceptions are thrown up and it works. So I’m guessing this follows the static type casting in unity.