CollectiblesController cc; //creates an instance of CollectiblesController void Start() { //gets the CollectiblesController's game object GameObject ccgo = GameObject.Find("CollectiblesController"); //makes the instance of cc equal to the script CollectiblesController cc = ccgo.GetComponent <CollectiblesController> (); }
void Start() { //getting the CollectiblesControler GAME OBJECT GameObject ccgo = GameObject.Find("CollectiblesController"); //getting the CollectiblesController SCRIPT from the //CollectiblesController game object cc = ccgo.GetComponent <CollectiblesController>(); }