system
1
NullReferenceException
sub.Start () (at Assets/Various/scripts/sub.js:50)
GameObject.Find ("endgame").GetComponent(GUITexture).enabled = false;
DaveA
2
It probably didn’t find a game object called ‘endgame’. Make sure spelling and Case are exact. Then make sure that object has a GUITexture on it. Short of using the debugger:
var go = GameObject.Find("endgame");
if (go)
{
var gt = go.GetComponent(GUITexture);
if (gt)
gt.enabled = false;
else
Debug.LogError ("endgame guitexture not found");
}
else
Debug.LogError ("endgame not found");