Changing TMP text through code

I know this has probably been asked, but how do you change text of a TMP text object? Thanks! :slight_smile:

Add a property to your class like below (making sure to use TextMeshProUGUI and not TextMeshPro)

public TextMeshProUGUI MyText;

or

[SerializeField]
private TextMeshProUGUI myText;

Then in your code write:

myText.text = “Hello World”.