Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
As with all of the other types of delegate, Events require their own special macro function. The first parameter is the class that the event will be implemented into. This will be the only class able to call Broadcast(), so make sure it is the right one. The second parameter is the type name for our new event function signature. We add an instance of this type to our class. The Unreal documentation suggests On<x> as a naming convention.
When something overlaps our TriggerVolume, we call Broadcast() on our own event instance. Inside the new class, we create a point light as a visual representation of the event being triggered.
We also create a pointer to TriggerVolume to listen to events. We mark the UPROPERTY as EditAnywhere ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access