Where I bind the delegate to an event, which can be custom that’s why I put it in a function.
However when I try to compile the BP i Get this :
The current value of the ’ Event ’ pin is invalid: ‘Event’ in action ‘Add Tag Listener BP’ must have an input wired into it (“by ref” params expect a valid input to operate on).
I precisely want to let that Custom Event be defined when the function is called on the actor on which the actor component is attached. If i do this I won’t be able to change what’s in the CustomEvent.
I’m not sure. I’ve just tried declaring a delegate as pointer, but it crashes the engine when playing, but maybe I’m doing something wrong.
If I declare the delegate in a regular way, I can send it as an argument, but that sends a copy, so it doesn’t really work, because you’re not binding to the delegate that’s being broadcast.
You can create a function in a function library, e.g. :
Are you trying to create one massive delegate with a lot of arguments, so that different actors would bind to the same even, but use different arguments? Or what is the purpose?
Basically I have a c++ class called “GameplayTagsManager” where I have 2 variables called ActiveTags(GameplayTagContainer) and ActiveTagsStacks(TMap Fname int32). The purpose of this actor component is to manage the add and removal of gameplay tags of the actor it is attached to. So other actor can add or remove tags from it, and some of them may need to know when particular tags are added or removed from the actor. For example I have a character, and an annemy spawn a poison Status effect actor on the character, damage are going to be applied to the character but if I have a gameplaytag on my character called let’s say “poison immunity” then the Poison actor needs to know if this tag is applied and when it’s added or removed. Then I can use that custom event to decide wheter I should apply or not damage to the actor and implement the logic in that custom event.