- Home /
"guiText" equivalent for TextMesh
In a script I can use the shortcut guiText to refer to the GUIText component attached to the object, but what's the equivalent for a TextMesh?
Comment
Best Answer
Answer by Shrandis · Oct 19, 2012 at 03:12 PM
There is no direct shortcut to a TextMesh component. You need to use GetComponent to access it.
TextMesh textMesh = gameObject.GetComponent<TextMesh>();
textMesh.text = "Hi there!";
Ah I see, thanks.
Don't understand why there's one for GUItext but not Text$$anonymous$$esh… $$anonymous$$
Your answer
![](https://koobas.hobune.stream/wayback/20220613082606im_/https://answers.unity.com/themes/thub/images/avi.jpg)