I’ve spent about an hour trying to figure out why I am not able to get my “score” to show up in the inspector under my ScoreKeeper script. Here is my ScoreKeeper scripts:
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class ScoreKeeper : MonoBehaviour {
public int score = 0f;
private Text myText;
void Start(){
myText = GetComponent<Text>();
Reset ();
}
public void Score(int points){
score += points;
myText.text = score.ToString ();
}
public void Reset(){
score = 0;
myText.text = score.ToString ();
}
}
Any help would be greatly appreciated!