Creating Event Dispatchers in UE5 Using Blueprints

Event Dispatchers are great to communicate between components. In this example the event dispatcher updates the player's health bar.

Unreal Engine 5 Blueprint event dispatcher playground level with damage and healer platforms
Quinn in front of the damage and healing platforms

Software Versions: Unreal Engine 5.4.4

Project Name: MyProject

Event dispatchers allow for Blueprints and other components to communicate with each other. In this example the player takes damage and then sends a message to the UI to update their health bar.

I started by creating a simple User Widget that has a red progress bar in the top left corner.

Unreal Engine 5 health user widget progress bar
Health Bar

I copied over the Third Person Template Blueprint to apply edits. In BeginPlay we can add the new W_Health UserWidget to the Viewport. In the User Widget I added a Player variable and exposed it on Spawn to allow the variable to be set via the character Blueprint.

Unreal Engine 5 third person character Blueprint for event dispatcher example with AnyDamage Event that calls Update Health
BP_ThirdPersonCharacter_Health

On the left side of the Blueprint we can add an Event Dispatcher, we can call it Update Health, and that allows us to call that event dispatcher inside the character Blueprint while the User Widget has the opportunity to subscribe to it.

In the BP_ThirdPersonCharacter_Health Blueprint when the player takes damage we set the Player's Health then call the Event Dispatcher. Inside the Health User Widget we bind to the event and update the progress bar with the new value.

Unreal Engine 5 User Widget for event dispatcher example that updates health progress bar
W_Health User Widget later renamed to W_Health_Mana

To showcase the event dispatcher I created a Blueprint that can damage or the heal the player every second the player stands on the platform.

Unreal Engine 5 Blueprint damage healer nodes for event dispatcher example
BP_DamageHealer_Actor

The BP_DamageHealer_Actor will apply damage to the actor on overlap every second and then clear the timer when the player exits. I also added a Heal boolean variable to reverse the damage for a healing platform.

Unreal Engine 5 damage platform event dispatcher updating health bar
Quinn running onto the damage platform

I had fun creating these dispatch events. Sometimes the challenge is just getting the correct pieces in the right places, hopefully this helps.

Loading...