Hey guys i have this prefab structure …
Prefab
- Sphere
- Clyinder
- Sphere
- 3D text…
Now i instantiate the prefab at runtime from this code :
GameObject go = (GameObject)Instantiate(Resources.Load(“Prefab1”));
After instantiating the prefab i want to change the text of 3D text depending on click of which element it is instantiated. And this is what i have tried as suggested by many post out here.But its giving me the Null reference exception.
go.GetComponent().text=symbol;
Can anyone suggest what the problem is there. ?