Hey everyone!
I have an actor component with some events that I would like to expose to its owning actor in BP. Currently, they’re declared as UPROPERTY(BlueprintImplementableEvent), but this isn’t working.
How would I create a C+±callable event which can be overridden in BP on the owning actor?
Multicast delegates! This is how I did it:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnUsedSignature, ACharacter*, InteractingCharacter, EInteractionIntent, Intent);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnStartFocusSignature);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnEndFocusSignature);
/**
* Fired when the component is set to be interactive and InteractWithTarget is called on the interacting component.
* @param InteractingCharacter - The character which initiated the interaction
* @param Intent - The intent of the interaction, such as Lockpick, Pickup or Conversation.
*/
UPROPERTY(BlueprintAssignable, Category = "Interaction")
FOnUsedSignature OnUsed;
/**
* Fired when EnableActorOutline sets at least one mesh to be rendered in the custom depth buffer.
*/
UPROPERTY(BlueprintAssignable, Category = "Interaction")
FOnStartFocusSignature OnStartFocusActor;
/**
* Fired when DisableActorOutline sets at least one mesh to not be rendered in the custom depth buffer.
*/
UPROPERTY(BlueprintAssignable, Category = "Interaction")
FOnEndFocusSignature OnEndFocusActor;
Then, call .Broadcast() to fire the event.