NISHIO Hirokazu[Translate]
スクリプトからTextを更新

cs
GameObject.Find("FooText").GetComponent<Text>().text = x.ToString();
テキスト自体に一意な名前"FooText"を振ってある場合。

FindでGameObjectを取った後Textにキャストしようとしたがそれは勘違いで、そのGameObjectにComponentとしてTextが入っているので、それをGetComponentすればよい。

テキストを持っている親オブジェクトに名前がある場合
cs
GameObject.Find("Foo").GetComponentInChildren<Text>().text = x.ToString();

スクリプトからTextを更新

"Engineer's way of creating knowledge" the English version of my book is now available on [Engineer's way of creating knowledge]

(C)NISHIO Hirokazu / Converted from [Scrapbox] at [Edit]