[Tutorial] Creating and Using Delegates C++ and Accessing them in Blueprints

stupid guides, where a full worked example how it works?
nobody knows is it working today, posted at 08-19-2014
delete this thread… or update

I’m struggling to find a good explanation on how to bind a function to an already created delegate.
I added this to my code, but I can’t figure out how to bind this to a C++ function which I can use in blueprint.


#include "Misc/CoreDelegates.h"
UFUNCTION()
void UserControllerConnectionChange(bool isConnected, int32 userID, int32 ControllerID);

I added this to the BeginPlay of the CPP


FCoreDelegates::OnControllerConnectionChange.AddUObject(this, &MyClass::UserControllerConnectionChange);

and the function the the end of the cpp


void MyClass::UserControllerConnectionChange(bool isConnected, int32 userID, int32 ControllerID)
{
}

Is this the right implementation?
How can I expose “UserControllerConnectionChange” the blueprint?

Update: I figured out that this I need to add this to an Actor and not to a SceneComponent.

inside the brackets of UFUNCTION write the specifer “BlueprintCallable”

UFUNCTION(BlueprintCallable)
void UserControllerConnectionChange(bool isConnected, int32 userID, int32 ControllerID);

hope that helps