- Home /
Question by
codeimpossible · Jul 27, 2019 at 05:36 PM ·
textmesh
TextMeshPro Text not displaying in built game
I have the following code in a MonoBehaviour that has been added to a GameObject that also contains a TextMeshPro component.
private void Start() {
var tmp = GetComponent<TMPro.TextMeshProUGUI>();
tmp.SetText("This is a test.");
}
The code works fine when running inside the editor, but nothing displays when the game is built and run. Any ideas about what could be causing this?
Comment
Best Answer
Answer by ExcaliburS1 · Jul 28, 2019 at 10:51 PM
-Check the z axis and adjust it
-Check the sorting layer.
-Check for the color of the text because it might be transparent.
My issue was the text color being transparent, great suggestion to check it!