I've looked up tons of scirpts for this but none of them really helped or made sence. Just simply trying to make a sound play when you hit an item
the i tried:
function OnTriggerEnter( otherObject: Collider ){
if(otherObject.gameObject.tag == "Player"){
audio.clip = otherClip;
audio.Play();
}
}
It works, but the problem is when i try to put Destroy(gameObject) anywhere in the script it either doesn't destroy but plays sound, or vice versa. What should i do. Thanks :D