Documentation
  • Introduction
    • Overview
  • Implementation
    • Getting started
    • Enable Replication
  • Functions
    • Quick Explanation
    • Bind Event
    • Unbind Event
      • Unbind All Events
      • Clear All Events
    • Call Event
    • On Event Called
  • Examples
    • Create a new Payload Object
    • Usage of Payload
    • Multiple Events in one Object
      • Bulk Variant
      • Using Messages
Powered by GitBook
On this page
  1. Examples

Usage of Payload

How to use the Payload obje

PreviousCreate a new Payload ObjectNextMultiple Events in one Object

Last updated 2 years ago

Network Environment

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 before proceeding with any examples for optimal results!

  1. Bind the event SaveScore in BeginPlay():

It is recommended to use Interfaces instead of casting!

Interface Setup

  1. Create a new Blueprint Interface and add a new function which has the same variables as your Payload as outputs.

  1. Implement the Interface to your Payload

If you cache a reference to a Payload for any reason, make sure to clear the variable as it won't be collected by the Garbage Collector otherwise.

the event and add one of the two code examples:

Done! Now you can use everywhere you want and pass a to it like this:

OnEventCalled()
CallEvent()
BPO_MyPayload
Implementation Guide
Add it to your Blueprint
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)
Optionally add a boolean named "Success" which can be used instead of HasInterfaceImplemented()
For this example I placed this into the Level Blueprint
Print result
Page cover image