[Solved] questions on text.text

I am just a little confused and seek clarification. I understand that the 1st text in ‘text.text’ is the public class Text, but I am wondering what function the ‘.text’ serves. Does the period declare that text changes to the new string? The docs on text.text weren’t super helpful.

The first text is a variable which you create that then needs a connection to the UI text element in the inspector. The .text is a property of the text variable that stores what you want to display.

So the variable can be named whatever you want however you will always need to use .text to change the displayed text.

At least that’s my understanding of it.

Privacy & Terms