UGameplayStatics::SetGlobalListenerFocusParameters
#include "Kismet/GameplayStatics.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallableBlueprintCosmetic
Description
Sets global listener focus parameters that scale how the audio system distinguishes sounds in front of the listener ('focused') from those outside the focus cone ('non-focused'). These multipliers affect azimuth, distance, volume, and priority.
Caveats & Gotchas
- • These parameters only take effect for sounds whose attenuation settings have Focus enabled. Sounds without focus azimuth settings in their SoundAttenuation asset are unaffected.
- • BlueprintCosmetic — no effect on dedicated servers. This is a pure client-side audio tuning call.
- • All parameters default to 1.0 (no change). Passing values without understanding the focus azimuth pipeline can produce subtle and hard-to-diagnose audio mix changes across the entire game.
Signature
static ENGINE_API void SetGlobalListenerFocusParameters(const UObject* WorldContextObject, float FocusAzimuthScale = 1.0f, float NonFocusAzimuthScale = 1.0f, float FocusDistanceScale = 1.0f, float NonFocusDistanceScale = 1.0f, float FocusVolumeScale = 1.0f, float NonFocusVolumeScale = 1.0f, float FocusPriorityScale = 1.0f, float NonFocusPriorityScale = 1.0f); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | Object used to retrieve the world context. | — |
| FocusAzimuthScale | float | Scale applied to the focus azimuth cone width for in-focus sounds. | 1.0f |
| NonFocusAzimuthScale | float | Scale for the focus azimuth of out-of-focus sounds. | 1.0f |
| FocusDistanceScale | float | Distance scale multiplier for in-focus sounds (>1.0 makes them audible further). | 1.0f |
| NonFocusDistanceScale | float | Distance scale multiplier for out-of-focus sounds. | 1.0f |
| FocusVolumeScale | float | Volume multiplier for in-focus sounds. | 1.0f |
| NonFocusVolumeScale | float | Volume multiplier for out-of-focus sounds. | 1.0f |
| FocusPriorityScale | float | Priority scale for in-focus sounds (higher priority means less likely to be culled). | 1.0f |
| NonFocusPriorityScale | float | Priority scale for out-of-focus sounds. | 1.0f |
Return Type
void Example
Boost focus sounds and reduce background sounds C++
// Increase volume and distance for focused sounds, reduce for non-focused
UGameplayStatics::SetGlobalListenerFocusParameters(
this,
1.0f, // FocusAzimuthScale
1.0f, // NonFocusAzimuthScale
1.5f, // FocusDistanceScale
0.75f, // NonFocusDistanceScale
1.2f, // FocusVolumeScale
0.6f, // NonFocusVolumeScale
1.0f, // FocusPriorityScale
0.8f // NonFocusPriorityScale
); Version History
Introduced in: 4.18
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?