RealDocs

UAudioComponent::AdjustAttenuation

function Engine Blueprint Since unknown
#include "Components/AudioComponent.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Overrides this component's attenuation settings with a custom settings struct, bypassing any shared USoundAttenuation asset reference.

Caveats & Gotchas

  • Attenuation settings are only read when a new Active Sound starts — call this before Play() rather than while the sound is already playing, or the change won't be picked up.
  • This sets bOverrideAttenuation-style behaviour internally, replacing the AttenuationSettings asset reference for this instance rather than modifying the shared asset.
  • Copies the full struct by value, so subsequent edits to the original FSoundAttenuationSettings variable after calling this have no further effect.

Signature

void AdjustAttenuation(const FSoundAttenuationSettings& InAttenuationSettings)

Parameters

Name Type Description Default
InAttenuationSettings const FSoundAttenuationSettings& The attenuation settings to apply as an override on this component instance.

Return Type

void

Example

Override attenuation before playing C++
FSoundAttenuationSettings CustomAttenuation;
CustomAttenuation.FalloffDistance = 2000.0f;
AudioComponent->AdjustAttenuation(CustomAttenuation);
AudioComponent->Play();

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.