RealDocs

UAudioComponent::GetAttenuationSettingsAsset

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

Description

Returns the USoundAttenuation asset referenced by this component's AttenuationSettings property, regardless of whether bOverrideAttenuation is enabled.

Caveats & Gotchas

  • Always returns the AttenuationSettings asset pointer even when bOverrideAttenuation is true and the asset isn't actually being used — check bOverrideAttenuation separately to know which source is active.
  • Not Blueprint-exposed; Blueprint code can read the AttenuationSettings property directly instead.

Signature

const TObjectPtr<USoundAttenuation> GetAttenuationSettingsAsset() const

Return Type

const TObjectPtr<USoundAttenuation>

Example

Logging the referenced attenuation asset C++
if (USoundAttenuation* Asset = AudioComponent->GetAttenuationSettingsAsset())
{
	UE_LOG(LogTemp, Log, TEXT("Using attenuation asset: %s"), *Asset->GetName());
}

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.