I have button I want to toggle my music on and off. However I don’t know how to check if the AudioSource is NOT playing. I tried to use “.isPlaying == false” as well.
case (3):
if (MusicPlayer.GetComponent<AudioSource>().isPlaying)
{
MusicPlayer.GetComponent<AudioSource>().Pause();
}
if (MusicPlayer.GetComponent<AudioSource>().!isPlaying)
{
MusicPlayer.GetComponent<AudioSource>().UnPause();
}
break;