I have a spaceship prefab, the prefab has a script associated to it which allows me to specify a laser prefab, which in turn has a laser impact script (c#). I have also created a GUIText which will hold the score, and that resides within my project.
I have extended the laser impact script functionality so that it exposes an additional public GUIText score, but when I try to drag the score GUIText onto it (so that its referenced) through the inspector it won’t allow me. I’ve noticed that I cannot drag objects onto any nested prefab public properties.
Is there a work around? Or how can I reference an already existing GUIText in my c# script? I have tried find on the GameObject, but the compiler throws an error due to type casting;
GUIText test;
test = GameObject.Find(“score”);
test.text = “HelloWorld”;
Apologies for the double question in one.