I’m writing the tutorial space shooter, and I am attempting to use the method AddScore from the GameController class.
Here is the method:
public void AddScore(int newScoreValue) {
score += newScoreValue;
UpdateScore ();
}
Then, in the DestroyByContact class i am trying to access it like this:
public GameController gameController;
public int scoreValue;
gameController.AddScore (scoreValue);
In the console this error reads:
Assets/Scripts/DestroyByContact.cs(23,32): error CS1061: Type `GameController' does not contain a definition for `AddScore' and no extension method `AddScore' of type `GameController' could be found (are you missing a using directive or an assembly reference?)
Anyone know why this might be?
thanks