So I have one script that gets the coins and adds to the score, but the coins are inconsistent
Some times it gives 5/coin, if I go quick thru multiple ones, it gives me 10/coin.
public static int score;
public Text scoreText;
public void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.tag == "Player")
{
Destroy(gameObject);
score += 5;
scoreText.text = "Score: " + score.ToString();
}
}
}
`.