- Home /
How to get text mesh to get updated during runtime
What the title above says :P. I'm using this for a username so when you type in the name the players name is updated.
#pragma strict
var tm : TextMesh = gameObject.GetComponent(TextMesh);
var username : String;
function Start () {
tm.text = username;
}
I haven't done a Text$$anonymous$$esh forever, so... what's wrong with this?
Im pretty sure that exact mechanism has worked fine for me in the past, I don't recall any further requirements.
Answer by RevCosmosis · Mar 29, 2014 at 11:39 PM
Did you mean to put tm.text = username;
in Start()
? I don't know since I can't see the rest of your code, but it might work in Update()
.
Thanks, that did the trick! I tried doing that at first but I must've done something wrong. Well anyways thanks!
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Update Function Work Around Question 2 Answers
Script wait for 3 seconds before running - stops it working altogether 2 Answers
Material doesn't have a color property '_Color' 4 Answers
Can you redefine functions with names like Update(), etc.? 2 Answers