I have a class class called ScoreKeeper , and another class called EnemyBehaviour.
Inside ScoreKeeper i have:
public void Score(int points){
score=score+points;
myText.text=score.ToString ();
}
Inside EnemyBehaviour I have:
public ScoreKeeper scoreKeeperObj;
void Start(){
scoreKeeperObj = GameObject.Find ("Score").GetComponent<ScoreKeeper>();
}
Whenever I change my method name from Score to something else… In both classes of course… I get nullReferenceException …
Why is that happening… Is the method Score , reserved in Unity ?