Quickstart
Last updated
Last updated
For a basic scenario we need two objects: one expecting an event to happen - we call it Subscriber, other being an originator of this event - we call it Sender.
Inside a class expecting an event, right-click anywhere on the event graph and search for Dispatchito Subsystem:
Drag a pin off of the given label and search for SubscribeToTopic function:
Press the dropdown for the Topic parameter and select desired tag for the topic of this event:
Drag from the Callback parameter and search for Add Custom Event:
Name your event handler and add logic you want to be executed when the event is sent through Dispatchito:
We are done here. Let's now set up the sender of the event.
Inside a class sending an event, right-click anywhere on the event graph and search for Dispatchito Subsystem:
Drag a pin off of the given label and search for DispatchEvent function:
In this case we are using Dispatchito subsystem directly, so make sure to select function variant that's not under Utilities group. Utilities provide 1:1 wrappers for functions that allow to skip using label of the subsystem. Always make sure to use proper variant.
Press the dropdown for the Topic parameter and select desired tag for the topic of this event:
Make sure to select the same topic as the subscriber.
That's all we need for this simple scenario.
Connect nodes to paths of execution in your code. E.g:
Subscribe in the actor's BeginPlay function:
Call DispatchEvent on a key pressed from a PlayerController:
Start PIE, press the bound button and watch the magic unfold:
Learn about Gameplay Tags from official .