Avatar

Noisy Kid Studios

Unleashing the UE Power

Need an UE developer? Contact Us

Delegates in Unreal Engine

March 31, 2026
What they are, why they are used, and basic implementation.

In Unreal Engine, delegates are a core mechanism for decoupling systems and enabling flexible communication between objects. If you come from other languages, you can think of them as type-safe function pointers or event dispatchers.


What is a delegate

A delegate is a reference to one or more functions that can be invoked at a given time. The key idea is that the caller does not need to know who is listening. This removes direct dependencies between classes.

Why they are used

The main purpose is decoupling logic. Instead of one system calling another directly, it exposes a delegate and any interested system can subscribe.

Typical use cases

  • UI reacting to player health changes
  • Updating stamina bars, ammo counters, or cooldown indicators
  • Triggering sound or VFX when an action occurs
  • Letting multiple systems react to the same gameplay event without hard references

Advantages

  • Low coupling between classes
  • More modular and reusable code
  • Supports event-driven architectures
  • Allows multiple listeners without extra logic

Disadvantages

  • Harder to trace execution flow if overused
  • Can introduce bugs if bindings are not managed properly
  • Slight overhead compared to direct function calls


Types of delegates in Unreal

Unreal provides several delegate types depending on the use case.

Single-cast delegates
Allow only one bound function.

DECLARE_DELEGATE(FOnHealthChanged);


Multicast delegates
Allow multiple subscribed functions.

DECLARE_MULTICAST_DELEGATE(FOnHealthChanged);

Dynamic delegates
Use reflection, required for Blueprints and serialization.

DECLARE_DYNAMIC_DELEGATE(FOnHealthChanged);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnHealthChanged);


Events
A restricted form of multicast delegate, safer for public APIs.

DECLARE_EVENT(UHealthComponent, FOnHealthChanged);


Key differences

  • Dynamic delegates use reflection, slower but required for Blueprint exposure
  • Multicast supports multiple listeners
  • Events restrict who can call Broadcast

Note: When using dynamic delegates, the target function must be marked with UFUNCTION().
This is required because dynamic delegates rely on Unreal reflection.
Without UFUNCTION(), the binding will fail or not compile depending on the case.


Basic implementation

Example using a health component that notifies when the player health changes.

1. Declaration

DECLARE_MULTICAST_DELEGATE_OneParam(FOnHealthChanged, float);

class UHealthComponent : public UActorComponent
{
public:
    FOnHealthChanged OnHealthChanged;

    void SetHealth(float NewHealth);
private:
    float Health;
};


2. Execution

void UHealthComponent::SetHealth(float NewHealth)
{
    Health = NewHealth;
    OnHealthChanged.Broadcast(Health);
}



3. Subscription

void AMyCharacter::BeginPlay()
{
    Super::BeginPlay();

    HealthComponent->OnHealthChanged.AddUObject(this, &AMyCharacter::HandleHealthChanged);
}

void AMyCharacter::HandleHealthChanged(float NewHealth)
{
    // update UI, trigger effects, etc.
}



4. Unbinding

Always clean up bindings if the object may be destroyed earlier.

if (HealthComponent) {
    HealthComponent->OnHealthChanged.RemoveAll(this);
}


Dynamic multicast for Blueprint

If you need Blueprint support:

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnHealthChanged, float, NewHealth);

UPROPERTY(BlueprintAssignable)
FOnHealthChanged OnHealthChanged;


You can then bind events directly in Blueprint, for example in a widget updating a health bar.

Best practices

  • Use multicast when multiple systems need to react
  • Use events when you want to restrict broadcasting
  • Avoid hiding critical logic behind delegates without documentation
  • Always unbind when appropriate to prevent invalid references
  • Prefer delegates over direct references in reusable systems


When not to use them

  • Simple communication between tightly coupled classes
  • Performance-critical code paths inside tight loops
  • Cases where explicit and traceable execution flow is more important than flexibility

Summary

Delegates are essential for building scalable systems in Unreal Engine. They allow you to separate responsibilities and avoid unnecessary dependencies. When used correctly, they make complex systems easier to maintain and extend.

🔍