|
Ok so I have a score system set up and i was wondering what do I put in the "Score" area so that the text displayed the scores that change here is the script:
(comments are locked)
|
|
Well, that script snippet isn't very useful, but that's ok. Assuming you have a 'score' variable (a float or int or whatever that stores what the current score is), you can use to set the text. Put this in Update, otherwise it won't change as your score gets updated. Otherwise, if you think it's too inefficient resetting the guiText.text every frame when your score doesn't update that often, you could inline it whenever you increment the score! Now, if you were using C# you could get even smarter, and set it up so that it's impossible to set the score without updating the GUIText! The fact that you can't do stuff like this in JavaScript is one reason I don't use that language...
(comments are locked)
|
