if (player == null) // Call this at the begnning of your camera script return; //and watch as your problems melt away.