Seamless BGM Fade-Out During Unreal Engine World Transitions: Troubleshooting & Game Instance
I’m facing a persistent issue in Unreal Engine where Audio Components used for background music (BGM) are being deleted along with the old world during world transitions. This causes the BGM to abruptly cut off even when it’s supposed to be fading out.
I’ve attempted several solutions without success:
I set bStopWhenOwnerDestroyed to false when creating FAudioDevice::FCreateComponentParams.
I enabled UISound.
I tried creating and owning the AudioComponent within a UGameInstanceSubsystem.
I implemented logic to prevent Stop() calls on the Audio Component if its sound state is FadingOut.
However, despite these efforts, the sound continues to stop abruptly whenever the entire world transitions.
Is there a reliable method to ensure that the BGM fades out naturally and completely even when the world changes? I need the sound to persist and complete its fade-out rather than being instantly terminated with the old world.
Confusion Regarding Game Instance & Audio
I recall seeing a YouTube video where they used CreateSound2D within the Blueprint’s Game Instance to prevent sound from cutting off during level changes. I’m unsure how this differs from the methods I’ve already attempted.
Ultimately, even if I create audio in the Game Instance, don’t I still need a world to attach the Audio Component to? I’m struggling to understand how creating the audio in the Game Instance truly solves the problem if the Audio Component still requires a world context that gets destroyed.