RealDocs

AActor::OnDestroyed

property Engine Blueprint Since 4.0
#include "GameFramework/Actor.h"
Access: public Specifiers: UPROPERTYBlueprintAssignable

Description

Delegate broadcast when this actor has been explicitly destroyed via Destroy(). Use it to notify other systems or clean up references without subclassing.

Caveats & Gotchas

  • Only fires when Destroy() is called explicitly. It does not fire when an actor is removed during level unload or streaming — use OnEndPlay for a more comprehensive teardown signal.
  • By the time bound handlers execute, the actor is already marked as being destroyed. Do not call methods that spawn new actors referencing this actor as an owner within the handler, as the owner may be invalid.

Signature

UPROPERTY(BlueprintAssignable, Category="Game")
FActorDestroyedSignature OnDestroyed

Examples

Print the destroyed actor's name when this actor is destroyed Blueprint
Event Destroyed Destroyed Actor Destroyed Actor Print String In String Get Display Name Object Return Value Return Value
Edit Blueprint graph Print the destroyed actor's name when this actor is destroyed
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Listen for actor destruction to remove it from a manager list C++
// In the manager
MyActor->OnDestroyed.AddDynamic(this, &AMyManager::HandleActorDestroyed);

void AMyManager::HandleActorDestroyed(AActor* DestroyedActor)
{
    ManagedActors.Remove(DestroyedActor);
}

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.