RealDocs

UAudioComponent::GetAttenuationSettingsToApply

function Engine Since 4.0
#include "Components/AudioComponent.h"
Access: public Specifiers: const

Description

Returns a pointer to the attenuation settings that will be used for this component's sounds — either the AttenuationOverrides struct or the settings from the referenced AttenuationSettings asset, depending on bOverrideAttenuation.

Caveats & Gotchas

  • Returns nullptr if attenuation is effectively disabled or no valid asset/override is configured — always null-check before dereferencing.
  • This is a C++-only accessor with no Blueprint equivalent; Blueprint code should use BP_GetAttenuationSettingsToApply, which copies the data into an output struct instead of returning a pointer.

Signature

const FSoundAttenuationSettings* GetAttenuationSettingsToApply() const

Return Type

const FSoundAttenuationSettings*

Example

Reading effective attenuation settings C++
if (const FSoundAttenuationSettings* Settings = AudioComponent->GetAttenuationSettingsToApply())
{
	float MaxDistance = Settings->GetMaxDimension();
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.