Hello, I was wondering how I could edit the text in a TextMeshProTextUI element since for me “TMP_Text”,“TextMeshProUGUI”, “TextMeshPro”, and “TMPro.TextMeshProUGUI” doesn’t work.
Example code:
version = GameObject.Find("version").GetComponent<TMP_Text>().text;
Thanks.
In your script add a public field and then in the Inspector, assign the text object whose text property you want to change.
public TMP_Text TextComponent;
Then in your code, simply do TextComponent.text = “Some text”;
Somehow, I’m getting an error. It cannot find the type nor can it find something to import.
You need to add
using TMPro;
I’m getting
.
Nevermind, had to add attribute.