I wrote this simple script to an i-pad game in which my Player should pick-up automatically apples (when Player and apple enter in touch) from the floor and add points to the score for that. I attached it as a this separate script to my Player and checked the Trigger marks, both in the apple and the Player. Although the easy this seems, the apple do not disappears; that is, I missed something I can't find. Any help, please.
var points : int = 0
function OnTriggerEnter(collisionInfo : Collider){
if(collisionInfo.gameObject.tag == "apple"){
points++;
audio.PlayOneShot(appleCollect);
Destroy(collisionInfo.gameObject);
}
}
@script RequireComponent(AudioSource)