{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

Bind Event to Dispatcher in Unreal Engine 5 C++UE Docs

Binding to a Blueprint Event Dispatcher in C++ uses AddDynamic, for example Target->OnHealthChanged.AddDynamic(this, &AMyActor::HandleHealthChanged);. The handler must be a UFUNCTION.

Blueprint node & C++ equivalent

C++
// Target's UFUNCTION handler is bound to its dispatcher:
Target->OnHealthChanged.AddDynamic(this, &AMyActor::HandleHealthChanged);

What does Bind Event to Dispatcher do?

Binding subscribes a function to a dispatcher so it runs whenever that dispatcher broadcasts. In C++ you call AddDynamic on the target object's delegate, passing the listener object and the address of its handler: Target->OnHealthChanged.AddDynamic(this, &AMyActor::HandleHealthChanged);.

Here Target is the object that owns the dispatcher, this is the object whose function will run, and &AMyActor::HandleHealthChanged is the handler. The handler's parameters must match the delegate signature.

The handler must be a UFUNCTION

AddDynamic only works with handlers marked UFUNCTION, because dynamic delegates resolve the bound function by name through Unreal's reflection system. If you forget the UFUNCTION macro on HandleHealthChanged, the bind will fail at runtime.

Use RemoveDynamic with the same object and function pointer to unsubscribe, and bind early, often in BeginPlay, once the target reference is valid.

Common mistakes

A frequent error is binding to a null Target; always confirm the target object exists before calling AddDynamic. Another is a parameter mismatch between the handler and the delegate, which prevents the bind from working.

Avoid binding the same handler twice, since the multicast delegate would then call it twice per broadcast. Pair every AddDynamic with a RemoveDynamic if the listener can outlive or be recreated independently of the target.

Frequently asked questions

How do I bind to an event dispatcher in C++ in UE5?+

Call AddDynamic on the dispatcher, for example Target->OnHealthChanged.AddDynamic(this, &AMyActor::HandleHealthChanged). The handler function must be marked UFUNCTION and match the delegate's parameters.

Why does AddDynamic require UFUNCTION?+

Dynamic multicast delegates look up bound functions by name using Unreal reflection, which is only available for functions marked UFUNCTION. Without it, AddDynamic cannot resolve and invoke the handler.

How do I unbind from a dispatcher in C++?+

Call RemoveDynamic with the same object and function pointer you passed to AddDynamic, for example Target->OnHealthChanged.RemoveDynamic(this, &AMyActor::HandleHealthChanged).

Related Events & Dispatchers nodes

View all Events & Dispatchers nodes →