Thursday, 26 April 2012

MAH SCREEPTS!

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();
}



1 comment:

  1. Iiinteresting. So you're doing Unity at the moment then? What are you going to use these sound scripts for?

    ReplyDelete