Skip to content

HUD Event

Overview

  • Sends an event, represented by a Gameplay Tag, do the owner's HUD.
  • The HUD can receive this event by implementing the IHUDEventDispatcherInterface.
  • The IA_Menu Action is assigned by default. This input triggers even when the game is paused.
  • Handles Triggered events.

The HUD Event Dispatcher Interface

Interface Implementation

This interface can be implemented in C++ or Blueprints. If you are doing that via Blueprints, keep in mind that it will be named HUDEventDispatcherInterface (without the "I" prefix).

Once the Handler executes, it will obtain the AHUD object available from the Owner. If this object is a valid implementation of the provided IHUDEventDispatcherInterface, then the Gameplay Tag representing the event will be provided.

This Handler nudges your HUD to implement an Event Dispatcher pattern and here's an example of how this would look like, if you follow this approach:

Let's say that you have three menus that can be opened during Gameplay: A Pause Menu, an Inventory Menu and a Weapon Wheel.

You can define a proper input for each one of these menus, along with a proper Gameplay Tag. From there, in your HUD, you can have a code that responds to each one of these events, toggling Widget states as necessary, opening or closing each window.