- Home /
How to change the text in TextMeshPro
I have a button but I can't change what the text displays through editor
Answer by DripSta · Oct 01, 2020 at 01:13 AM
That's because the button doesn't have the TextMeshPro component added to it, it has a child with the TextMeshPro component on. Try changing the text of the child component of the button via the editor. Alternatively, you could try changing it via script
using TMPro;
public class TextMeshProTestb: MonoBehaviour { public TextMeshProUGUI tmp;
void Start () { tmp.text = "What you want the button's text to be"; } } Then drag in the child of your button component (with the TextMeshPro Component on it) as the tmp refernce in the editor and everything should work
Your answer
![](https://koobas.hobune.stream/wayback/20220613012856im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to change the background of GUIStyle? 0 Answers
A game entirely made with the new UI ? 1 Answer
Enable UI Button from Prefab 1 Answer
UI Text won't appear at all. 1 Answer