Hello! I have six different zones for scoring, three which award 1 point, two which award 3 points, and the ground level which subtracts 1 point. These all work as intended on their own (egg goes into 1 point basket, 1 point appears where I need it to), but when I drop an egg into another zone, it displays it’s own score in the same area as the others.
My question is how do I make the individual scores add/subtract to/from a “total” score instead of the score for each individual zone?
public Text scoreText;
private int score;
public int pointValue;
private void Start()
{
score = 0;
}
private void Update()
{
}
public void OnTriggerEnter(Collider other)
{
UpdateScore(pointValue + score);
}
public void UpdateScore(int scoreToAdd)
{
score = +scoreToAdd;
scoreText.text = "Score : " + score;
}
Thank you in advance!!