Clicker Game Newbie

Hello Guys!

  1. Sorry for my English! (germanboy)

  2. Im new here and i have so many Idears for games

  3. I’ve started and Clicker but my Problem is.

I want an Sprite like a "Block " that u can Tap and earn Money for that.

How can do this? i have this code :

public class Click : MonoBehaviour {

    public UnityEngine.UI.Text goldDisplay;
    public int gold = 0;
    public int goldperclick = 1;

    void Update(){
        goldDisplay.text = "Gold: " + gold;

    }

    public void Clicked () {
        gold += goldperclick;
           }

}

But How i can Connect the Value of gold i have and the “button” ?

Tahnks x) Sorry again for my bad english.

And i know there are many tutorials but i dont understand where i can solve this problem with this x)

Willkommen to the forums!

To connect your button the functionality you’ve defined, ensure this script is attached to a GameObject in your scene. Then select your button in the hierarchy, and in the Inspector, look for the OnClick portion of the Button component. Drag the object this script is attached to onto that slot, and choose the Component → Method from the dropdown, like so:

1 Like

I need someone who can show me this :smile:

More so than the instructions and image I just posted? Okay.

2 Likes