I can't find code that finds a TMP_Pro object by name, tag or whatever.

I’m trying to access a TMP_Pro text on the UI from a prefab that gets instantiated after the start of the game. This means that, in order to change the text of the TMP_Pro object, it needs to “find” the object in the scene. I can’t find any code that does this the way one would with finding a GameObject.

Here you go. This will work on a new TMP GameObject called “Text (TMP)”

using UnityEngine;
using TMPro;

public class FindTMP : MonoBehaviour
    void Start()
        GameObject tmpGO = GameObject.Find("Text (TMP)");
        TextMeshProUGUI tmp = tmpGO.GetComponent<TextMeshProUGUI>();
        tmp.SetText("Any Text");