So I have 12 game objects that can be pressed with an OnMouseDown() function. When the object is clicked some texts appairs. I also have a overall score counter of how many you have collected. But how do I have it so they only count once to the score and the text still appairs after you have collected it. Right now you can click one multiple times and the score goes up.
Here is my scoring system script
public GameObject scoreText;
public static int theScore;
void Update()
{
scoreText.GetComponent<Text>().text = "Found collectibles " + theScore + " of 12";
}
And here is my collecting script
void OnMouseDown()
{
ScoringSystem.theScore += 1;
}