In order to implement triggered sound into my video game environment I require three scripts depending on how I want the sound to trigger. The Scripts are as follows:
Trigger Sound:
function OnTriggerEnter()
{
audio.Play();
}
function onTriggerExit()
{
audio.Stop();
}
Click to trigger sound:
function OnMouseDown()
{
audio.Play();
}
Collision sound:
function OnCollisionEnter()
{
audio.Play();
}
Iiinteresting. So you're doing Unity at the moment then? What are you going to use these sound scripts for?
ReplyDelete