RealDocs

UAbilitySystemComponent::OnAvatarActorDestroyed

function GameplayAbilities Since 4.15
#include "AbilitySystemComponent.h"
Access: public Specifiers: UFUNCTION

Description

Internal callback bound to the avatar actor's OnDestroyed delegate. Clears the AvatarActor pointer and cleans up AbilityActorInfo when the physical avatar is destroyed separately from the owner.

Caveats & Gotchas

  • Do not call this manually — it is bound as a delegate and called automatically by the engine's actor destruction path; calling it directly will clear AvatarActor prematurely.
  • This is separate from ClearActorInfo, which is the full teardown path; OnAvatarActorDestroyed only handles the avatar pointer and fires when the avatar but not the owner is destroyed (e.g. respawn scenarios).

Signature

UE_API void OnAvatarActorDestroyed(AActor* InActor)

Parameters

Name Type Description Default
InActor AActor* The actor being destroyed (expected to be the current avatar actor).

Return Type

void

Example

Understanding the destruction callback chain C++
// Engine internals (for reference only — do not replicate in game code):
// When InitAbilityActorInfo is called:
AvatarActor->OnDestroyed.AddDynamic(
    this, &UAbilitySystemComponent::OnAvatarActorDestroyed);
// When avatar is destroyed at runtime, this automatically fires.

Version History

Introduced in: 4.15

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.