UAudioComponent::FadeOut
#include "Components/AudioComponent.h"
Access: public
Specifiers: virtualUFUNCTIONBlueprintCallable
Description
Smoothly ramps the playing sound's volume down to FadeVolumeLevel over FadeOutDuration seconds. If FadeVolumeLevel is 0, the sound is stopped after the fade completes.
Caveats & Gotchas
- • If FadeVolumeLevel is greater than 0, the sound is not stopped after the fade — it continues at the reduced volume. Pass 0.0f to stop after fading out.
- • OnAudioFinished fires when the sound stops after a fade to 0, matching the behavior of Stop(). Handlers should not assume natural completion.
- • FadeOut operates on the currently playing instance and does not restart the sound.
Signature
virtual void FadeOut(float FadeOutDuration, float FadeVolumeLevel, const EAudioFaderCurve FadeCurve = EAudioFaderCurve::Linear) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| FadeOutDuration | float | Duration in seconds over which volume ramps from current level to FadeVolumeLevel. | — |
| FadeVolumeLevel | float | Target volume at end of fade. Pass 0.0f to fully silence and stop. | — |
| FadeCurve | EAudioFaderCurve | Interpolation curve shape. | EAudioFaderCurve::Linear |
Return Type
void Example
Fade out music over 5 seconds and stop C++
MusicComp->FadeOut(5.0f, 0.0f, EAudioFaderCurve::Logarithmic); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?