L
L
LittleBob2021-12-05 23:47:34
Unity
LittleBob, 2021-12-05 23:47:34

How to write something to Text through a script?

The point is that I have this line:
Text.text = score.ToString();
score is a numeric value. I need the text to also display "/50", like score/50. I don't understand how to do it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GFX Data, 2021-12-06
@ShockWave2048

int score = 50;
Text.text = "/" + score;

F
freeExec, 2021-12-06
@freeExec

Text.text = (score / 50).ToString();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question