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?

-Check the z axis and adjust it

-Check the sorting layer.

-Check for the color of the text because it might be transparent.