|
I am trying to make a basic scoring system and it is adding strings not numbers. here are my script: var score = 1; var GUIScore : GUIText; function OnTriggerEnter( other : Collider ) { if (other.tag == "Coin") { GUIScore.text += score; Destroy(other.gameObject); } } How do I make it add numbers instead of strings (It starts off at 0 and when I pick a coin up it displays 01 and then 011, etc.)
(comments are locked)
|
|
Try this:
I hope it helps. Yay it works. thanks heaps!
Aug 19 '10 at 03:37 PM
MonkeyAssassin8
(comments are locked)
|
|
when you gain score increase a numerical variable score and set it to be the newly displayed text - GUIScore.text = score; // not +=
(comments are locked)
|
