Sending event
Last updated
Last updated
Sending event is achieved by calling DispatchEvent
function and selecting:
Topic of the event
(Optional) Payload object to pass with the event
(Optional) Whether to include parent topics
A GameplayTag
based identifier for the event "type". Upon dispatch all subscribers will have their bound callback functions called for the subscriptions made to this topic.
A UObject
based payload object that can optionally be attached to the event. A reference to this object is passed to each callback function being called.
Due to hierarchical nature of GameplayTag
, this allows to call subscribers of topics up the hierarchy. E.g., given topic MyAwesomeGame.SuperTag
, a call to DispatchEvent
with bIncludeParentTopics
set to true, would execute subscribers of both MyAwesomeGame.SuperTag
and MyAwesomeGame
. This functionally works as a scoped "subscribe to all", allowing for some level of control instead of brute-forcing subscription to all topics and selecting only specific ones in the handler.