Adding +1 Points Every Time Button Clicks

Hi,

I am trying to code a script that will allow me to add 1 subscriber per every
click of the Upload button, here is a picture of what i’m talking about.

Here’s my script so far:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Button : MonoBehaviour {

int AddSubs = 0;

public void AddToSubs(){
AddSubs += 1;
GetComponent().text = “Subscribers:” + AddSubs;
}
}

Please help!

Have you activated the button so it works on click?

throw Debug.log(Addsubs);

in the update to see if it’s being added

“get the text component on the current gameobject”… I’d say it’s a fair bet this script isn’t on the displaying text gameobject.

Yeah it isn’t, but when ever i add a public Text Subscribers; and drag and drop the subscribers text into the field it doesn’t work either