- Home /
Changing GUItext value
How do I change the guitext string value with a counter value? for example:
var Counter: int=1;
function Update(){
Counter++; GameObject.Find("Score_Text").guiText.text=Counter.ToString;
}
It gives me an error of function(): string not compatible with string value.
Thanks,
Comment
Best Answer
Answer by KiraSensei · Dec 23, 2012 at 10:36 PM
Try :
GameObject.Find("Score_Text").guiText.text=Counter.ToString();
ToString is a method, not a variable, so it need "()" after.
Your answer
Follow this Question
Related Questions
Move the text in a GUI Button/Box 1 Answer
GUI.label overlapping text 1 Answer
Gui Text Script 4 Answers
Alpha not working in GUITex 0 Answers
Intro GUI Text Script... 3 Answers