Hi dear UE community,
Edit: It works now, my problem was elsewhere.
I’m trying to use MultiCast Delegate to fire an event the same way as OnComponentHit works for collision.
I have declared a Delegate in my file AShip.h:
USTRUCT(BlueprintType)
struct FDamageStruct
{
};
...
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnDamageTaken, const FDamageStruct&, Damage);
...
In my class:
UPROPERTY(BlueprintAssignable, Category = "Damage")
FOnDamageTaken OnDamageTaken;
in my file AShip.cpp
OnDamageTaken.Broadcast (damage);
On an another class i register a function to this event with:
Skill.cpp:
MyShip->OnDamageTaken.AddDynamic(this, &ASkill::OnShipDamageTaken);
with Skill.h
UFUNCTION()
void OnShipDamageTaken(const FDamageStruct& Damage);
My problem is:
During execution time my function OnShipDamageTaken is never call.
If I check the variable OnDamageTaken i see my function is registered.
Does anyone know why my function could not be called ?
Thx
References:
https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Delegates/index.html