Most of the events we've been using, such as BeginPlay and Tick, are called from C++. We've taken a look at how to create our own in Blueprints, and now we'll see how to create them in C++ for use in our own Blueprints.
For this, we will start in the header file. Events are created much the same way our normal and pure functions were, but we use the BlueprintImplementableEvent specifier. We'll also add an output float that we can log:
For this one, we won't implement the function in the .cpp file, so ignore the green line under the function name.
In the .cpp file, we'll add a call to our custom Event in the BeginPlay function to keep it simple. We just need to add one line at the end, and we'll hardcode a value of 256 for the output:
That's all we need for the C++ side of things, so compile the code and head back into...