UAudioComponent::SetUISound
#include "Components/AudioComponent.h"
Access: public
Specifiers: UFUNCTIONBlueprintCallable
Description
Marks sounds generated by this component as UI sounds, which typically exempts them from 3D spatialization, world pausing, and gameplay volume ducking.
Caveats & Gotchas
- • UI sounds generally continue playing while the game is paused, since they're not tied to gameplay time — useful for menu click sounds.
- • This must be set before the component starts playing to reliably affect that playback instance; changing it mid-playback may not retroactively alter an already-started sound.
- • Does not automatically 2D-ify a 3D-configured SoundCue/SoundWave asset — spatialization settings on the sound asset still apply on top of this flag.
Signature
void SetUISound(bool bInUISound) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| bInUISound | bool | Whether sounds played by this component should be treated as UI sounds. | — |
Return Type
void Example
Mark a menu click sound as UI C++
ClickAudioComponent->SetUISound(true);
ClickAudioComponent->Play(); See Also
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?