Hi there i wont to know is there a way like i build a castle on terrain and when enter in castle to play a music or a a sound like in wow when enter in Stormwind there play a song in the city till u leave the city any solution ?
Yes there is. Look into OnTriggerEnter() and audio.play.
var sound : AudioClip;
function OnTriggerEnter ( collision : Collider ) {
Debug.Log( “OnTriggerEnter” );
print("Triggered: " + collision.tag);
if( collision.gameObject.tag == “What Ever Your Tag For The Object” ) { //Put a cube where you want to play a sound tag it what you want to tag it
{
audio.PlayOneShot(sound);
}
yield WaitForSeconds (1); //This is to load a level. Remove it if you dont want it
Application.LoadLevel(“Lose”);
}
}
Read this!!! http://adf.ly/urfzX