void Start ()
{
UILabel subtitle = GameObject.Find("GameObject").GetComponent<UILabel>();
subtitle.text = "AAAAAAAAAAAAAAAAAAAAAAAAAA";
Debug.Log(subtitle.text);
}
This code can not show any text on the screen.What is wrong? Please
void Start ()
{
UILabel subtitle = GameObject.Find("GameObject").GetComponent<UILabel>();
subtitle.text = "AAAAAAAAAAAAAAAAAAAAAAAAAA";
Debug.Log(subtitle.text);
}
This code can not show any text on the screen.What is wrong? Please
What is the name of your GameObject.
You need to provide The object name
On my screenshot it is a “Label”
and i use “UILabel subtitle = GameObject.Find(“Label”).GetComponent();”
[3147-screen+shot+2012-08-30+at+3.40.25+pm.png|3147]
just change Z vlaue 0 to -1