Hello unity developers! I’m a junior game dev and I’ve encountered an issue while trying to get an AudioSource to play on a button click.
public AudioSource ButtonCloseSFX;
public void Close()
{
SummaryOpen = false;
ButtonCloseSFX.Play();
SummaryMenuObject.SetActive(false);
}
When the button is clicked, the audio source won’t play, I’ve tried testing it with PlayOnAwake and the audio does play. Just when called via script it doesn’t play.
I’m running 2019.4.35f, any help would be appreciated.