how to change the text of a text component in unity with code code example
Example: unity change text
// To change text of a text UI element use th combination below
textGameObject.GetComponent<UnityEngine.UI.Text>().text = "text";
// To change text of a text UI element use th combination below
textGameObject.GetComponent<UnityEngine.UI.Text>().text = "text";