Question by
NinjaRubberBand · Mar 09, 2016 at 04:42 PM ·
uitext
Change UI Text in script
So since unity 5, i have been having problems changing the Ui text in a script. I want to keep an score, but what i used to do doesn't work anymore. I tried searching throw answers and stuff, but i haven't found anything that helped me. Can someone tell me how to change ui text in a script? I am using Javascript.
Comment
Answer by Ali-hatem · Mar 09, 2016 at 06:08 PM
i don't use Javascript but i think you will get the idea
int Score = 1;
public Text mytext; //attach the UI text to this script.
void Start ()
{
mytext.text = "Score: "+Score;
}
Your answer
Follow this Question
Related Questions
Accessing UI text 0 Answers
Best Fit only scales up. 1 Answer
Get height of text with given width. 0 Answers
Text not showing in build (but the rest of UI shows up) 1 Answer