G
G
GREAT DNG2021-05-03 14:22:06
C++ / C#
GREAT DNG, 2021-05-03 14:22:06

How to put text in Unity.UI.Text.text?

There is a code, but for some reason it does not put the required line in text:

TimeLabel.GetComponent <Text> ().text = "Time: " + Time;

Time is an int variable.

How to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-05-03
@GREAT_DNG

mb ? $"TimeLabel: {Time}"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question