Hi.
I’m using the function OnMouseDown() to detect when the object has been touched and destroy it, My code is:
void OnMouseDown(){
GetComponent<AudioSource> ().Play ();
NotificationCenter.DefaultCenter().PostNotification(this, "addScore", myPoints);
Invoke ("destroyBall", 0.1f);
}
void destroyBall(){
Destroy (this.gameObject);
}
The code works in the computer, but when I test it in my phone, sometimes works, and sometimes doesn’t work. I test in anothers devices and it’s the same.
Any idea?