Hello, I want to execute in the Start of the script to set a text in to “texto”, but when I execute it on Start dont works.
If I use execute it on the Update it works but its no in the beginning, the update will send the messages 60frames x sec.

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class ShowZenis : MonoBehaviour
{
    // Start is called before the first frame update

    private ZeniManager zm;
    public TextMeshProUGUI texto;
    public int dinero;
    void Awake()
    {
            zm = gameObject.AddComponent<ZeniManager>(); //Instanciamos un nuevo objeto, en MonoBehaviour se instancian así.
            texto = (GameObject.Find("Monedas").GetComponent<TextMeshProUGUI>());
    }
    // Update es llamado una vez por cada frame.
    void Start(){

            dinero = zm.getZenis();
            texto.SetText("" + dinero);
    }
    public void OnClickIt() {

        if(gameObject.name == "ButtonAdd") {

            zm.addMoney(40);
            dinero = zm.getZenis();
            texto.SetText("" + dinero);
            //PlayerPrefs.DeleteAll();
        }
    }
}

IF I USE START:
alt text

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class ShowZenis : MonoBehaviour
{
    // Start is called before the first frame update

    private ZeniManager zm;
    public TextMeshProUGUI texto;
    public int dinero;
    void Awake()
    {
            zm = gameObject.AddComponent<ZeniManager>(); //Instanciamos un nuevo objeto, en MonoBehaviour se instancian así.
            texto = (GameObject.Find("Monedas").GetComponent<TextMeshProUGUI>());
    }
    // Update es llamado una vez por cada frame.
    void Update(){

            dinero = zm.getZenis();
            texto.SetText("" + dinero);
    }
    public void OnClickIt() {

        if(gameObject.name == "ButtonAdd") {

            zm.addMoney(40);
            dinero = zm.getZenis();
            texto.SetText("" + dinero);
            //PlayerPrefs.DeleteAll();
        }
    }
}

IF I USE UPDATE:alt text

You will say me: use the Update, but the problem is when I use the Update I cant modify the text, like its forever don’t know how to say it.

Thanks.

Perhaps something else sets the text of texto after you have set it, overriding your text. I don’t recall if you could change the Script Execution Order of Start calls.

Also you could do an if (!loadedTexto) { loadedTexto = true; texto.SetText("" + dinero); } where you set the value once in Update. A bit of a hack, but should do it.