- Home /
How to stop Audio
function Update ()
{
if (Input.GetKeyDown ("w"))
{
audio.Play ();
}
else (Input.GetKeyUp ("w"))
{
audio.Stop ();
}
}
I know its messed up at the Stop. I need to know how to make it to where when I release "w" the audio stops. Right now when I press "w" and release it the sound continues.
Comment
Answer by Seth-Bergman · Jul 22, 2012 at 01:02 AM
else if(Input.GetKeyUp ("w"))
otherwise this should work