- Home /
Why Prefab.GuiText.text dosent update in Update() func?
I have a GuiText prefab. It dosent work after instantiated and update text in the Update() function. Is there anyone,have faced same problem?
Comment
Answer by ArkarKyaw · Sep 07, 2012 at 11:12 AM
GameObject Subtitle;
string Subtitle_text;
void Start ()
{
Subtitle = (GameObject)Resources.Load("Subtitle");
Color alpha = Subtitle.guiTexture.color;
alpha.a = 0.1f;
Subtitle.guiTexture.color = alpha;
Instantiate(Subtitle);
}
void SetSubTitle(string text)
{
Subtitle_text = text;
}
void Update ()
{
Subtitle.guiText.text = Subtitle_text;
}
This is my part of code.Please :(
Your answer
Follow this Question
Related Questions
C#, How do I make the GUIText Show up if Instantiate from a prefab. 1 Answer
Link GUIText to a prefab? 2 Answers
Instantiate a 2d Pop up 1 Answer
GUITextures not lining up correctly 2 Answers
Changing the text of a GUIText 2 Answers