I’ve been looking for a pick-up sound script for a while now and I’ve come across this one:
var collectSound:AudioClip;
function OnTriggerEnter (other:Collider) {
if(other.gameObject.tag=="Player"){
AudioSource.PlayClipAtPoint(collectSound, transform.position);
}
}
I have a ball that rolls around a maze which is tagged “Player” and I already have a pick-up system in place I just need the sound added. When I add this to my pick-up objects nothing seems to happen? I put the desried sound effect in the variable but it still makes no sound?
Any have any idea why it does nothing? xD