Audio Fader
Opt an AudioSource into smooth fade-out during scene transitions
Overview
Audio Fader is a lightweight marker component. Attach it to any GameObject with an AudioSource and it will automatically be picked up by the loading screen when Audio Fade Mode is set to Interface Objects.
This opt-in approach means only the sources you explicitly tag are affected.
Usage
Add Audio Fader component to a GameObject that has an AudioSource
On your loading screen prefab, set Audio Fade Mode to Interface Objects
Configure Fade Duration and Restore On Complete as needed
When a load is triggered, matching sources fade out automatically
Audio Fade Modes
The fade behaviour is configured on the LoadingScreen component, not on AudioFader itself. The mode determines which sources are collected before the scene changes.
| Mode | Description |
|---|---|
None | No audio fading. |
InterfaceObjects | Fades all AudioSource components that have a AudioFader attached. Opt-in, no search overhead. |
SearchInScene | Finds and fades all currently playing AudioSource components in the scene. Simple, but costly on large scenes. |
Explicit | Fades the sources listed in LoadParameters.audioSourcesToFade. Best for persistent cross-scene sources. |
Restore on Complete
When audioFade.restoreOnComplete is enabled on the loading screen, all faded sources have their volumes restored to their original values once the loading screen closes.
This is most useful in Additive or Transition Only load modes, where the AudioSources may still exist after loading.
In Single mode, scene-owned sources are destroyed with the old scene and will not restore.