About the score

I used a different code than what you showed in the video and it is

scoreText.text = "Score: " + currentscore;

to have the word “Score” shown in the UI.

can I do it with the way you explained it in the video without getting rid of the word “Score” ?

Hi Saleh,

You’d either need to do what you are doing now, e.g. concatenate the strings, or, create another Text UI GameObject which you could use as a label, I’d probably stick with just the one Text UI personally if you want the word “Score” there as well, you won’t have to worry about any spacing between them that way.

1 Like

Thank you sir

You’re very welcome.

Incidentally, I’d probably only add the word “Score” if it was really necessary too. For example, if its kinda obvious that its the player score, e.g. starts at 0, goes up when they shoot things and there isn’t anything else in the player HUD then perhaps you don’t even need a label. If you have lives too, rather than representing this like this;

“Lives : 3”

you could for example have three icons of the player’s paddle, but smaller, or three hearts or something else which visually indicates the players lives - this can again save you from needing to stamp the words in the hud and save a bit of space :slight_smile:

1 Like

Privacy & Terms