Binding blueprint method/event to C++ delegate

In case you haven’t solved this, or for others reference - you need to ensure the delegate in your C++ component has the UPROPERTY set to BlueprintAssignable.

You should have your delegate declared as DYNAMIC_MULTICAST somewhere and have a variable defined in the component like in the following example:

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FExampleDelegate_OnSomething, float, _exampleEventParameter);

UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
class YOURPROJECTNAME_API UComponentExample : public UActorComponent
{
    GENERATED_BODY()

public:
    UPROPERTY(BlueprintAssignable)
        FExampleDelegate_OnSomething ExampleDelegateVariable;
}

To access this in a Blueprint, get the component reference in the Event Graph and pull off of it to create a node, this will allow you to create a node to - assign to the delegate; bind an event to the delegate; call the delegate; unbind event(s) from the delegate.

13 Likes