counting

I have a prefab with a script attached to it, I am trying to access a text GameObject to count up, I tried plenty of things. My code:

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

public class TreeItem : MonoBehaviour
{
    public GameObject obj;
    public float itema = 0;
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("tree").GetComponent<Transform>();
    }
    public void Wreck()
    {
        Debug.Log("clicked");
        itema = itema + 1;
        Destroy(this.gameObject);
    }
    void Update()
    {
        Tree.text = itema.ToString();
    }
}

What is the issue exactly?

the text object will not count up, also the script is on a prefab

The code counting up never runs

???

You never call Wreck

it destroys the object

Yeah, and it’s the only place with counting. So it will never count

so… how do I make it count up

Put the count code somewhere which runs, like update (once per frame)
I dont know what you wanna do

also, one thing the text I want to count up is not a prefab but the object that the script is attached to is a prefab

Okay?
Whatever you want is doable