Hello, i am desperate to find solution. Here is my code on button. When i first time click button, sound !!!SOMETIMES!!! works, after that u can click that button all day long , it doesnt play any sounds… Whats wrong here? Pls help…
public void OnMouseDown()
{
if(GetComponent<AudioSource>().isPlaying)
{
GetComponent<AudioSource>().Stop();
GetComponent<AudioSource>().PlayOneShot(sound);
}
else
{
GetComponent<AudioSource>().PlayOneShot(sound);
}