Keep in mind when using UObjects as payloads that they're not replicated, you either have to make your own replication for UObjects or use a replicated Actor (although this isn't recommended). If you choose to use Actors as payloads, make sure to destroy it if it's not in use anymore!
We are recommending to use theMessageinput instead to transfer any simple informations!
Make sure you have read the Implementation Guide before proceeding with any examples for optimal results!
Bind the event SaveScore in BeginPlay():
Add it to your Blueprint
Implement the OnEventCalled() event and add one of the two code examples:
It is recommended to use Interfaces instead of casting!
Quick way with casting, not recommended for large scale
(Click on the image for original resolution)
Using Interfaces is recommended to avoid unnecessary dependencies
(Click on the image for original resolution)
Interface Setup
Create a new Blueprint Interface and add a new function which has the same variables as your Payload as outputs.
Optionally add a boolean named "Success" which can be used instead of HasInterfaceImplemented()