Adding Increment value to a text on button click

I’ve been watching tutorials daily on how particular scripts would act, so far what I am working with is a canvas-Button-and UI Text. Basically all I am looking to achieve is the text on game-screen “Gold: 0” to rise on button click. I notice in my inspector my value goes up, but does on in the UI Text, my script is as follows.

using UnityEngine;
using System.Collections;

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;
}

}

Any help would be greatly appreciated, thanks!

You need to associate your script/function to the button in the Editor and you are making things a little more difficult than they should be. If you only want your increment to occur when the button is clicked you simply put that into your “clicked” function. In other words…

public void clicked() {
    Gold += Goldperclick;
    GoldDisplay.text = "Gold: " + Gold;
}

… there’s no need to put anything in update (which, as @NoseKills says, should be Update() not update() anyway) as it’s a per click function, not a per frame one.

A function called Update() will get called automatically by Unity. A fuction called update() won’t.