Hi all! I am doing a sound design degree, and to get extra marks in this particular module I need to do some coding.
So basically my code is all setup (watching youtube video’s as I am a complete beginner) so that when you press the space bar a random sound will play.
However I don’t want to have to press the space bar to activate, instead I would like for the sound to play at random times, but without playing more then one audio at a time. I have searched for hours and I can’t seem to find anything.
Any help on the matter would be greatly appreciated!
here is the current snippet of code, however if you require the whole thing in order to solve this let me know:
void Update ()
{
if (Input.GetKeyDown ("space"))
{
PlaySound ();
}
}
Thanks in advance!