RealDocs

UAudioComponent::OnUnregister

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

Description

Called when the component is unregistered from its owning world, at which point it tears down any in-flight audio state tied to the component's lifetime.

Caveats & Gotchas

  • Engine-internal ActorComponent lifecycle hook — override only when extending UAudioComponent itself, and always call Super::OnUnregister() first.
  • Unregistration can happen well before BeginDestroy() (e.g. during a component re-registration triggered by an editor property change), so don't assume this means the component is being destroyed.

Signature

virtual void OnUnregister() override

Return Type

void

Example

Override pattern for a derived audio component C++
void UMyAudioComponent::OnUnregister()
{
    // Custom teardown before base class runs
    Super::OnUnregister();
}

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.