RealDocs

UActorComponent::IsReadyForOwnerToAutoDestroy

function Engine Since 4.14
#include "Components/ActorComponent.h"
Access: public Specifiers: virtual

Description

Returns whether this component will block its owning actor from auto-destroying. Override to return false while the component still has work in progress, preventing premature actor destruction.

Caveats & Gotchas

  • The actor checks all components via this method before auto-destroying — returning false from any one component will delay destruction until all return true.
  • This is only relevant when the actor has bAutoDestroyWhenFinished set to true (common on audio and particle components).
  • The base implementation always returns true, so forgetting to override means the actor can auto-destroy while your component is still active.

Signature

virtual bool IsReadyForOwnerToAutoDestroy() const { return true; }

Return Type

bool

Example

Block auto-destroy until async work completes C++
bool UMyStreamingComponent::IsReadyForOwnerToAutoDestroy() const
{
    // Prevent actor from auto-destroying while we are still streaming data
    return !bStreamingInProgress;
}

Version History

Introduced in: 4.14

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.