Hello.
I want to bind a method in a component to the OnTakeAnyDamage event of the owning Actor.
OnTakeAnyDamage as defined in Actor.h:
UPROPERTY(BlueprintAssignable, Category="Game|Damage")
FTakeAnyDamageSignature OnTakeAnyDamage;
FTakeAnyDamageSignature:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams( FTakeAnyDamageSignature, float, Damage, const class UDamageType*, DamageType, class AController*, InstigatedBy, AActor*, DamageCauser );
The method I want to bind in the component:
UFUNCTION()
void TakeDamage(float Damage, UDamageType* const DamageType, class AController* InstigatedBy, class AActor* DamageCauser);
Now, in the constructor of the component I want to bind the TakeDamage method to the owning actor’s OnTakeAnyDamage delegate.
I can access GetOwner()->OnTakeAnyDamage, which has an Add() method, but nothing I try works.
What’s the syntax for this?
Thanks.