how make the coin not increased when the player touch them more than one?
hallo master.. i need some help i have a script ( score script) and i want to make the coin when the player touch the coin more than one, the coin can't increase my score. i need only a touch to increase the score. more than that the value does not increase.
how can i setup my script??? please
public int scoreTogive = 100;
private ScoreManager theScoreManager;
// Use this for initialization
void Start () {
theScoreManager = FindObjectOfType<ScoreManager> ();
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D (Collider2D bojo)
{
if (bojo.gameObject.name == "Player")
{
theScoreManager.AddScore(scoreTogive);
}
}
}
Comment