ue-delegates-and-events

Implements Unreal C++ delegate and event bindings across single-cast, multicast, and dynamic families.

55|5|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/kevinpbuckley/unreal-engine-skills --skill ue-delegates-and-events-kevinpbuckley
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ue-delegates-and-events
Source: https://github.com/kevinpbuckley/unreal-engine-skills/tree/main/skills/core/ue-delegates-and-events
Command: npx skills add https://github.com/kevinpbuckley/unreal-engine-skills --skill ue-delegates-and-events-kevinpbuckley

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Wiring callbacks and events in Unreal C++ is error-prone: choosing the wrong delegate family breaks Blueprint visibility, unsafe lambda bindings crash on destroyed objects, and mismatched macros cause compile failures. This Skill provides the correct macros, binding forms, and lifetime rules for every delegate scenario in UE 5.8. ## Core Features & Use Cases - Delegate family selection: Decision tables for single-cast (DECLARE_DELEGATE, _RetVal), multicast (DECLARE_MULTICAST_DELEGATE, TS variant), and dynamic multicast (BlueprintAssignable) delegates. - Binding and lifetime safety: Full coverage of BindUObject, AddUObject, BindLambda, AddWeakLambda, BindRaw, AddSP, FDelegateHandle management, and EndPlay cleanup patterns. - Blueprint integration: AddDynamic/RemoveDynamic wiring, UFUNCTION requirements, UPROPERTY specifiers, and serialization behavior of dynamic delegates. - Use Case: When exposing a C++ health-changed event that both C++ systems and Blueprint HUDs must subscribe to, use this Skill to declare a dynamic multicast delegate, bind UFUNCTION handlers safely, and avoid dangling-binding crashes. ## Quick Start Use the ue-delegates-and-events skill to declare a BlueprintAssignable dynamic multicast delegate for an OnDied event and bind a UFUNCTION handler to it.

Frequently Asked Questions about ue-delegates-and-events

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I expose a C++ event to Blueprints in Unreal Engine?

Declare a dynamic multicast delegate with DECLARE_DYNAMIC_MULTICAST_DELEGATE and expose it as UPROPERTY(BlueprintAssignable). Blueprint graphs can then bind custom events via an Assign node, and C++ handlers bind with AddDynamic on a UFUNCTION-marked method.

What is the difference between DECLARE_MULTICAST_DELEGATE and DECLARE_DYNAMIC_MULTICAST_DELEGATE?

DECLARE_MULTICAST_DELEGATE is C++-only, faster, and supports payload variables, but cannot be BlueprintAssignable. DECLARE_DYNAMIC_MULTICAST_DELEGATE integrates with reflection, supports Blueprint binding and serialization, but requires UFUNCTION handlers and named parameters.

Why does my Unreal delegate crash when broadcasting?

Crashes typically come from AddLambda or AddRaw bindings whose captured object was destroyed, since these forms have no lifetime tracking. Store the returned FDelegateHandle and call Remove in EndPlay, or use AddUObject or AddWeakLambda for weak-reference safety.

Can Unreal multicast delegates have return values?

No, multicast and dynamic multicast delegates cannot return values; only single-cast delegates support return values via DECLARE_DELEGATE_RetVal. Use Execute after checking IsBound, or ExecuteIfBound for a safe no-return call.

How do I remove a dynamic delegate binding in Unreal C++?

Call RemoveDynamic with the same object and UFUNCTION pointer passed to AddDynamic, for example OnDied.RemoveDynamic(this, &AMyHud::HandleDied). The binding is matched by function name string, so the method must be identical.

When should I use TFunction instead of a delegate in Unreal?

Use TFunction or TUniqueFunction for a stored callable that is not an event, such as a one-off callback passed as a parameter. Delegates are the right choice for observer-pattern events with one or many listeners.