triggers problem

Hello.
I have a bug, in the ontrigger functions they do not detect anything.
I must be missing something because it’s only in this script.
What is the problem?

public class DañoJugadorZona : MonoBehaviour
{
    public float dañoFisico;
    public float dañoMagico;
    private bool EsFisico = false;
    private bool EsMagico = false;

    public float cadencia;
    private float c;
    public float tiempo;
    private float t;

    private bool listo;
    private Collider2D col;

    void Start()
    {
        if(dañoFisico != 0){  EsFisico = true; }
        if(dañoMagico != 0){  EsMagico = true; }

        t = tiempo;
        c = cadencia;
        listo = false;
    }

    void Update()
    {
        if(t <= 0){  Destroy(gameObject); }
        else{  t -= Time.deltaTime; }

        if(c <= 0 && listo) {
            HacerDaño();
            c = cadencia;
            listo = false;
        }
        else{  c -= Time.deltaTime; }
    }
   
    void OnTriggerStay2D(Collider2D colision)
    {
        Debug.Log("Stay " + colision);
        if(colision.transform.CompareTag("Enemigo"))
        {
            col = colision;
            listo = true;
        }
    }

    void OnTriggerEnter2D(Collider2D colision)
    {
        Debug.Log("Enter " + colision);
        if(colision.transform.CompareTag("Enemigo"))
        {
            col = colision;
            listo = true;
        }
    }

    void HacerDaño(){
        if(EsFisico)
        {
            col.transform.GetComponent<VidaEnemigo>().DañoFisico(dañoFisico);
        }

        if(EsMagico)
        {
            col.transform.GetComponent<VidaEnemigo>().DañoMagico(dañoMagico);
        }
    }
}

Have you gone through all the necessary steps listed in the documentation to receive OnTrigger calls?

You neglected to point out that:

  • Yes, you doublechecked the spelling of those functions
  • Yes, you have a Rigidbody2D
  • Yes the Rigidbody2D is simulated
  • Yes you are moving the Rigidbody2D ONLY with either its own power or with .MovePosition()

etc. etc etc

I fixed it. It was like loading wrong unity. But now that it’s rebooted, it’s working.