Score system isn't working help needed,score system isn't working help needed

I am trying to make a score system for each time when a sprite hits its corresponding sprite though whatever I do it will never work

public class script : MonoBehaviour
{
    public float speed;
    private float score;
    private void Start()
    {
        score = 0;
        Updatescore();
    }
    private void Update()
    {
        transform.Translate(Vector2.left * speed * Time.deltaTime);
        
    }
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag ("Player"))
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);

        }
        if (other.tag == gameObject.tag)
        {
            
      
            Destroy(other.gameObject);
            Destroy(gameObject);

            score += 1;
            Updatescore();
        }
        else
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
        }
    }
    private void Updatescore()
    {
        Text txt = transform.Find("score").GetComponent<Text>();
        txt.text = score.ToString();
    }

score += 1;
Updatescore();
at line 29 should be above

Destroy(gameObject);

at line 27

You are calling Destroy(gameObject); before updating the score and hence the UpdateScore() function is not getting called at all