RealDocs

AActor::OnTakeAnyDamage

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

Description

Delegate broadcast whenever this actor takes any form of damage (point, radial, or generic). Bind to this in Blueprint or C++ to react to damage without overriding TakeDamage.

Caveats & Gotchas

  • Only fired on the server (or in single-player). It is not replicated to clients — do not drive cosmetic feedback solely from this delegate without additional replication.
  • This fires after TakeDamage has already processed the damage. The Damage parameter reflects what was actually applied, which may differ from what was requested if TakeDamage was overridden to modify it.

Signature

UPROPERTY(BlueprintAssignable, Category="Game|Damage")
FTakeAnyDamageSignature OnTakeAnyDamage

Examples

Deduct damage from a Health variable when this actor takes any damage Blueprint
Event AnyDamage Damage Damage Type Instigated By Instigated By Damage Causer Damage Causer Health Health Health Health Health float - float
Edit Blueprint graph Deduct damage from a Health variable when this actor takes any damage
Drag node headers to move · Drag from an output pin to an input pin to connect · Scroll to zoom · Right-click for actions
Bind in C++ to react to any damage C++
// In BeginPlay or constructor
OnTakeAnyDamage.AddDynamic(this, &AMyActor::HandleAnyDamage);

// Handler signature
void AMyActor::HandleAnyDamage(AActor* DamagedActor, float Damage, const UDamageType* DamageType, AController* InstigatedBy, AActor* DamageCauser)
{
    UE_LOG(LogTemp, Warning, TEXT("Took %.1f damage"), Damage);
}

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.