- Home /
This question was
closed Apr 18, 2014 at 11:52 PM by
AlucardJay for the following reason:
Duplicate Question : http://answers.unity3d.com/questions/689842/music-zones-play-music-with-tags.html
Music Zones play music with tags?
I'm trying to make music zones, enter a music zone and it will play music according to the area. I want it all in one script. I figured out how to do it with tags, but I think I'm doing it terribly wrong :(.
#pragma strict
var MusicZone1Adventure : AudioClip;
function Start () {
}
function Update () {
}
function OnTriggerEnter() {
if (gameObject.tag == "MusicZone1Adventure") {
audio.PlayOneShot = MusicZone1Adventure;
}
}
Can anyone point out what I'm doing wrong? Thanks in advance!
Comment