RealDocs

UAudioComponent::IsReadyForOwnerToAutoDestroy

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

Description

Returns whether this component has finished doing what it needs to do, allowing an owning actor spawned with bAutoDestroy set (e.g. via UGameplayStatics::SpawnSoundAtLocation) to be destroyed once playback completes.

Caveats & Gotchas

  • Returns false while the sound is still playing or fading out, which is why fire-and-forget spawned audio actors linger for the duration of the clip before being garbage collected.
  • Only relevant for actors that opt into auto-destroy — if the owning actor doesn't have bAutoDestroy set, this return value is never consulted.

Signature

virtual bool IsReadyForOwnerToAutoDestroy() const override

Return Type

bool

Example

Query readiness before manually destroying an owner C++
if (AudioComponent->IsReadyForOwnerToAutoDestroy())
{
    GetOwner()->Destroy();
}

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.