Hi, I have this function to check if someone click on the object:
void OnMouseDown() {
gc.SendMessage ("AddPoints", 1);
Destroy (this.gameObject);
}
But every time I click this function is performed twice. Why? How can I fix it?
Hi, I have this function to check if someone click on the object:
void OnMouseDown() {
gc.SendMessage ("AddPoints", 1);
Destroy (this.gameObject);
}
But every time I click this function is performed twice. Why? How can I fix it?
I found out the source of the problem, and it is a silly mistake from me. Personally, i add the same script as a component to the same GameObject so the OnMouseDown() was executed twice…
You should checkout if you did the same mistake as me.