- Home /
Change TextMesh text in script
Hi!
I need to change the text in a TextMesh in a script. I have googled it, look it up here but no luck. If you know how to do this, please tell me!
Thanks
Also, I'm working in C#
Comment
Best Answer
Answer by RealMTG · Mar 21, 2014 at 04:03 PM
I got it fixed.
How I did it:
I made a new variable
public string theText;
Then I added this in a void update.
void Update () {
TextMesh t = (TextMesh)gameObject.GetComponent(typeof(TextMesh));
t.text = theText
}
Your answer
Follow this Question
Related Questions
Adjusting the transform width to match wrapped text (TextMeshPro) 0 Answers
Change Textmesh.text from script 2 Answers
Unity crashes at writing TextMesh? 0 Answers
Adjust text file reading/detection 0 Answers