48. Listen with On Event
Figure 31. On Event selects an engine event. The dispatcher starts that entry when the event is emitted.
1. Create a separate listener graph, such as custom_listener.
2. Add On Event. Choose OnCustomEvent for this first example.
3. Connect it to a simple condition or variable update.
4. Save and restart the preview so it contains the new listener.
5. Cause the real event, or use Emit Event from another graph.
On Event entries are found across the project’s Visual Scripts. They are different from an On Interact graph that must be assigned to a particular object. A listener can react without being assigned to the object’s own verb action.
Several event entries can live in one graph. The dispatcher supplies the matching entry node ID. A default manual run does not test every entry, and it does not reproduce every event’s context.
Do not put duplicate reward logic in both a global OnInteraction listener and the object’s own Use action. Both can be reached for one player interaction. Give one system responsibility for the reward.
