Hey all, Im currently trying to throw an Event in a custom cpp and listen to that event in a blueprint.
My current use case for this would be my health bars. I want to have multiple health bars that can be refilled on their own.
I already have taking damage to the players health and regenerating it nailed down (Im overriding the standard TakeDamage function for taking Damage and I’ve written a custom heal function). but I just cant figure out how to listen to the changes in Health.
I have already tried creating an event like this
DECLARE_DYNAMIC_MULTICAST_DELEGATE_FiveParams(
FOnHealthChanged, // Name of the structure that will be generated
AActor*, Instigator, // Who caused the health change
UCurrentHealthComponent*, ChangedComponent, // Component that called the event
float, NewValue, // New health value
float, OldValue, // Old health value
bool, OverKill // If damage value was higher than health value
);
and exposing the event of that Healthcomponent to Blueprints like this
UPROPERTY(BlueprintCallable)
FOnHealthChanged OnHealthChanged;
I am then broadcasting my event in my cpp like this
OnHealthChangedEvent.Broadcast(EventInstigator, this,this->Value, originalValue, isOverkill)
But In my Blueprint editor, I cannot drag a node relating to my FOnHealthChanged event. Is there something Im missing?