Course contentsShow
← Unreal Engine Game Development
Lesson 53 of 8801. Foundations and Editor WorkflowFree lesson

Utilizing BlueprintAssignable Delegates

Students will implement multicast delegates to notify Blueprint systems of asynchronous events occurring within the C++ core.

In this lesson, you will learn how to use BlueprintAssignable delegates to broadcast events from C++ that trigger custom logic inside your Blueprints.

The "Radio Station" Concept

Think of a BlueprintAssignable delegate as a radio station. Your C++ code acts as the broadcaster, sending out a signal whenever something important happens—like a player picking up an item or a timer finishing. Any Blueprint that is "tuned in" (bound) to that specific frequency will instantly react. This is perfect for decoupled architecture, where your C++ logic doesn't need to know exactly which Blueprint is listening or what that Blueprint intends to do with the information.

Setting up the Delegate

To create this bridge, you must define the delegate signature and then declare it as a property with the BlueprintAssignable specifier.

// 1. Declare the delegate signature
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnItemPickedUp, FString, ItemName);

UCLASS()
class MYGAME_API AItemActor : public AActor
{
    GENERATED_BODY()

public:
    // 2. Expose the delegate to Blueprints
    UPROPERTY(BlueprintAssignable, Category = "Events")
    FOnItemPickedUp OnItemPickedUp;

    void PickupItem(FString Name)
    {
        // 3. Broadcast the event to all listeners
        OnItemPickedUp.Broadcast(Name);
    }
};

Bridging to Blueprints

Once you have compiled this code, go to your Blueprint class derived from AItemActor. In the Details panel or by right-clicking on your actor in the Event Graph, you will see OnItemPickedUp appear under the "Event" section. By clicking the "+" icon, you add an event node. Now, whenever Broadcast() is called in C++, your Blueprint node executes.

This mechanism is asynchronous, meaning the C++ core handles the notification, and the Blueprint simply reacts to it whenever the event fires. It allows your level designers to wire up sounds, particles, or UI updates in the Blueprint editor without modifying the underlying C++ code.

Key Takeaway: BlueprintAssignable delegates provide a clean, decoupled way for your C++ systems to broadcast events, allowing Blueprints to react to game logic without requiring hard-coded dependencies.