Sending event

Sending event is achieved by calling DispatchEvent function and selecting:

  1. Topic of the event

  2. (Optional) Payload object to pass with the event

  3. (Optional) Whether to include parent topics

Topic of the event

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.

Payload

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.

Including parent topics

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.

Last updated