From ue5-style-guide
Creating UE5 delegates, event dispatchers, or callback systems
How this skill is triggered — by the user, by Claude, or both
Slash command
/ue5-style-guide:cpp-delegates-eventsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Delegates provide type-safe callbacks for event-driven programming in Unreal Engine.
Delegates provide type-safe callbacks for event-driven programming in Unreal Engine.
| Type | Blueprint | Multiple Bindings | Use Case |
|---|---|---|---|
| Single | No | No | Internal C++ callbacks |
| Multicast | No | Yes | C++ event broadcasting |
| Dynamic Single | Yes | No | Single Blueprint callback |
| Dynamic Multicast | Yes | Yes | Blueprint event dispatchers |
// Single-cast (C++ only)
DECLARE_DELEGATE(FOnSimpleEvent);
DECLARE_DELEGATE_OneParam(FOnHealthChanged, float);
DECLARE_DELEGATE_TwoParams(FOnDamage, float, AActor*);
DECLARE_DELEGATE_RetVal(bool, FOnValidate);
// Multicast (C++ only)
DECLARE_MULTICAST_DELEGATE(FOnSimpleMulticast);
DECLARE_MULTICAST_DELEGATE_OneParam(FOnScoreChanged, int32);
// Dynamic (Blueprint compatible)
DECLARE_DYNAMIC_DELEGATE(FOnDynamicSimple);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnDeathSignature);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnHealthChangedSignature, float, NewHealth);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnDamageSignature, float, Damage, AActor*, Instigator);
FOnScoreChangedSignature// In header - declare delegate type
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnHealthChangedSignature, float, NewHealth);
UCLASS()
class UHealthComponent : public UActorComponent
{
GENERATED_BODY()
public:
// BlueprintAssignable exposes to Blueprint Event Graph
UPROPERTY(BlueprintAssignable, Category = "Events")
FOnHealthChangedSignature OnHealthChanged;
void TakeDamage(float Amount)
{
CurrentHealth -= Amount;
OnHealthChanged.Broadcast(CurrentHealth); // Notify all listeners
}
};
// C++ binding
MyDelegate.BindUObject(this, &UMyClass::HandleEvent);
MyMulticast.AddUObject(this, &UMyClass::HandleEvent);
// Lambda binding
MyDelegate.BindLambda([](float Value) { /* ... */ });
// Dynamic binding (Blueprint compatible)
MyDynamicDelegate.AddDynamic(this, &UMyClass::HandleEvent);
MyDynamicDelegate.AddUniqueDynamic(this, &UMyClass::HandleEvent); // Prevents duplicates
| Practice | Reason |
|---|---|
| Use AddUniqueDynamic | Prevents duplicate subscriptions |
| Wrap complex data in USTRUCT | Blueprint compatibility |
| Use Multicast for events | Single-cast Events are deprecated |
| Sparse delegates for rare events | Memory optimization |
| Check IsBound() before ExecuteIfBound() | Avoid crashes |
// Always unbind in destructor or when no longer needed
MyDelegate.Unbind();
MyMulticast.RemoveAll(this);
MyDynamicDelegate.RemoveDynamic(this, &UMyClass::HandleEvent);
Documentation: https://dev.epicgames.com/documentation/en-us/unreal-engine/delegates-and-lamba-functions-in-unreal-engine
npx claudepluginhub rickym-h/jadefall-marketplace --plugin ue5-style-guideExpert guidelines for Unreal Engine 5.x C++ development covering UObject lifecycle, reflection system, performance patterns, and Epic's naming conventions.
Defines boundaries between Blueprints and C++ in Unreal Engine, keeping graphs readable and avoiding hidden architecture from graph sprawl.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.