Hi,Im new to unity and I don’t understand why you need to add a .tostring to a .text for example I
saw the roll-a-ball tutorial and the man did "CountText.text = “count : " + count.ToString ();”
why is that.
Hi,Im new to unity and I don’t understand why you need to add a .tostring to a .text for example I
saw the roll-a-ball tutorial and the man did "CountText.text = “count : " + count.ToString ();”
why is that.
CountText.text
is a string
. count
is an integer, so needs to be converted to a string. If you need help in general with c# programming, then try doing searches which shows official answers:
The .ToString() function turns the count var into a readable string var.