Event Dispatchers
An Event Dispatcher allows a Blueprint to inform other Blueprints when an Event happens. The Level Blueprint and other Blueprint classes can listen to this Event, and they may have different Actions that run when the Event is triggered.
We create Event Dispatchers in the My Blueprint panel. As an example, let's create a Blueprint named BP_Platform
. When an Actor overlaps the BP_Platform
Blueprint, it calls an Event Dispatcher called PlatformPressed
. The Level Blueprint is listening for the PlatformPressed
Event and spawns an explosion when this Event is triggered:
- Create or use an existing project based on the Third Person template with the starter content.
- Create a Blueprint and use Actor as the parent class. Name it
BP_Platform
and open it in the Blueprint Editor. - Click the Add button in the Components panel and choose the Static Mesh Component. In the Details panel, choose the Shape_Cylinder Static Mesh and change the Z value of the Scale...