Hey all! I need help to make a sound play when my player enters a trigger, and then the trigger be destroyed. Here is what I have now: `var soundFile:AudioClip;
function OnTriggerEnter(trigger:Collider) {
if(trigger.collider.tag=="collider1") {
audio.clip = soundFile;
audio.Play();
Destroy (gameObject);
}
}
What I need help with is this script to be attached to the collider to detect the player by calling the tag “Player” I’m new to scripting so if anyone can help at all thanks a bunch!