Changing audio source clip, but audio doesn't play.

Hi, I’m trying to make small script that changes the music depending on the level (due to unrelated reasons, every level uses the same scene but it’s modified with a script). The audio clip is changed, but it doesn’t play. What am I doing wrong, and why doesn’t the sound play?

The part of the script that involves the audio

The object with the script and the audio source (The listener is in another object, I already checked it and it works)

After executing the script.

Where is your code playing the source?

1 Like

Have you tried right after the line: m_MyAudioSource.clip = audioFacil; wirte this line of code: m_MyAudioSource.Play();