UE5 Delegate Parameters vs Payload Data

You may be wondering what’s the difference between UE5 Delegate Parameters and Payload Data as described in the Delegate documentation.

Jump to the “Payload Data Example Use Case” section for an explanation by example if you prefer examples.

The Callback Function Signature

The main difference between Payload Data and Parameters has to do with the binding function’s signature.

The binding function/callback signature has to match our delegate parameters PLUS desired extra parameters(payload data).

 

Delegate Parameters

  • Required in EVERY callback function that wishes to bind to our delegate.
  • Defined when delegate is created with DECLARE_DELEGATE or any similar macro.
  • If you want every Bound function to receive data/argument as part of it’s signature, you include it as a delegate Parameter.

Delegate Payload Data

  • Required ONLY IN callback functions that wish to receive extra parameters, in addition to the required parameters above,  from our delegate when it broadcasts/executes.
  • Defined when delegate is bound (bind is called) to our function.

Payload Data Example Use Case

You already have a function that takes in 8 parameters and it’s being used in other parts of your code.

The first two arguments of the function match our new delegate function parameters. So:

We already have a function that takes in 8 arguments and we want to bind it to a delegate that passes only 2 parameters. 

The solution is to pass the rest of the 6 arguments required by the function as Payload data at BIND time.

5/5

Welcome to our audio and rhythm plugins collection! With MidiEngine, you can easily import MIDI files and use midi events to create engaging rhythm gameplay or enhance your videos.

4.5/5

Plugin that helps add UMG Widgets to Level Sequences for Text Layers, Movie Titles, 2D layers and more… directly within sequencer. Cross platform.

5/5

Let your end users Split And Resize The UI at runtime. Perfect for both games and Applications.

Consider investing in some of our plugins. They might save you some time.  Also helps supports these tutorials.

Instantly get access to our plugins like Blender Curves Importer and UMG Cinematics and more when  you support us on Patreon!

 Join Us On Discord For More Daily Tips!