In the class PlayerControl I have this
if (Input.GetKey("space"))
{
soundManager.PlayBleep();
sword.SetActive(true);
}
In my soundmanager I have this
public void PlayBleep()
{
if (!audio.isPlaying) {
audio.PlayOneShot(SwordWhip2);
}
}
At the moment I am getting the sound like 10 times each time I press space creating horrible soundeffects. How could I get it not to play until the sound has finished?