I created one UI text under canvas.
Buttons are placed under canvas.
UI text is renamed as score. I dragged and dropped it in button. There are four buttons. Four buttons have these script attached.
public Text score;
public void OnButtonClick(int num) {
score.text = "Score : 1";
}
NullReferenceException: Object reference not set to an instance of an object
Buttons.OnButtonClick (Int32 num) (at Assets/Scripts/Buttons.cs:21)
The 21 line is : core.text = “Score : 1”;
Please help how to fix it.