Unreal Engine 4.x Scripting with C++ Cookbook - Second Edition
by John P. Doran, William Sherif, Stephen Whittle
How it works...
The UINTERFACE/IInterface are created in exactly the same way that we saw in the other recipes in this chapter. When we add a function to the interface, however, we use a new UFUNCTION specifier, BlueprintImplementableEvent.
BlueprintImplementableEvent tells the Unreal Header Tool to generate code that creates an empty stub function that can be implemented by Blueprint. We do not need to provide a default C++ implementation for the function.
We implement the interface inside Blueprint, which exposes the function for us in a way that allows us to define its implementation in Blueprint. The autogenerated code that's created by the header tool forwards the calls to the UInterface function to our Blueprint implementation.
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