Forum rules - please read before posting.

Audio Source sounds stop in game menu

Hello, I use Unity UI prefab for in game menu. And I check Pauses Game. When menu is open somehow it also pauses Audio Source components (which is not a good option for me). Is there a way to disable this behavior?

Comments

  • Which sounds specifically are being paused?

    Music and Ambience tracks have a "Can play while paused?" option in their Storage windows, while Sound components have their own "Play while game paused?" option in their Inspectors.

  • I'm talking about AudioSource components of Unity

  • If you use AC's Sound component to play sounds, available from the Logic panel in the Scene Manager, then you can check "Play while game paused?".

    If you're using AudioSource without AC's involvement, you need to attach a script to them:

    using UnityEngine;
    public class AllowPauseAudio : MonoBehaviour
    {
        void OnEnable()
        {
            GetComponent<AudioSource>().ignoreListenerPause = true;
        }
    }
    
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.