writing code

im trying to write code and i am bad at it. I have a simple question how could i have a counting number by the click of a button then a image pops up. Like if i click the button 1000 times and then a image turns visible

This is for UI button only so if you need game object it’ll require ray casting so right now is UI but just tell me if you need to use a game object button. Make a script then what you would do is create a variable for the amount of times the button is clicked. So every time the button is pressed it will call a method to increment the clicks amount and check if it has reached the max clicks set. This script will do all of that and it worked for me so use this script to detect the clicks:

public GameObject image;
    public int maxClicks = 1000; 
    private int clicks; //The current number of clicks

    public void Increment()
    {
        clicks = clicks + 1;
        if (clicks == maxClicks)//Checks to see if the clicks reach what you set maxClicks to
        {
            image.SetActive(true);
        }
    }

Drag this onto the button in the hierarchy then on the button in the inspector under On Click() drag the script from the inspector not the project folder onto the text box saying None (Object) or this will not work. If done right it will now say Button (Clicks). Click on No Function and go to the one with the name you gave the script then Increment (). Now drag the image as a game object onto the image part of the script and that should work. Hope this helped you and let me know if you have any questions.