Hello,
I make a game where the player is supposed to click thing to get points, but only one click per object. I tried this code, but it doesn’t work, and the player keeps getting points if clicks on the same object.
Any help?
function OnMouseDown () {
var hitted : boolean;
if(!hitted)
{
var score : ScoreCounter = GameObject.Find("Score").GetComponent("ScoreCounter");
score.scorePoints ++;
hitted = true;
}
}