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

**URL:** <https://forums.unrealengine.com/t/tutorial-creating-and-using-delegates-c-and-accessing-them-in-blueprints/9649>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 18, 2014, 4:36pm UTC](https://forums.unrealengine.com/t/tutorial-creating-and-using-delegates-c-and-accessing-them-in-blueprints/9649 "2014-08-18T16:36:45Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![KGB1st](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KGB1st](https://forums.unrealengine.com/u/KGB1st)\
**Post date:** [November 25, 2019, 8:54am UTC](https://forums.unrealengine.com/t/tutorial-creating-and-using-delegates-c-and-accessing-them-in-blueprints/9649/21 "2019-11-25T08:54:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Szysz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/szysz/32/1194564_2.png) [@Szysz](https://forums.unrealengine.com/u/Szysz)\
**Post date:** [March 10, 2021, 9:22pm UTC](https://forums.unrealengine.com/t/tutorial-creating-and-using-delegates-c-and-accessing-them-in-blueprints/9649/22 "2021-03-10T21:22:30Z")

</div>

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.

```auto

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

```

I added this to the BeginPlay of the CPP

```auto

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

```

and the function the the end of the cpp

```auto

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.

---

<div class="post-metadata">

**Author:** ![Damion\_Knife](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Damion\_Knife](https://forums.unrealengine.com/u/Damion_Knife)\
**Post date:** [February 16, 2022, 9:12pm UTC](https://forums.unrealengine.com/t/tutorial-creating-and-using-delegates-c-and-accessing-them-in-blueprints/9649/23 "2022-02-16T21:12:08Z")

</div>

inside the brackets of UFUNCTION write the specifer “BlueprintCallable”

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

hope that helps

---

<div class="post-metadata">

**Author:** ![SkyeEden](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/skyeeden/32/1116094_2.png) [@SkyeEden](https://forums.unrealengine.com/u/SkyeEden)\
**Post date:** [March 16, 2022, 12:34pm UTC](https://forums.unrealengine.com/t/tutorial-creating-and-using-delegates-c-and-accessing-them-in-blueprints/9649/24 "2022-03-16T12:34:06Z")

</div>



[Previous page](https://forums.unrealengine.com/t/tutorial-creating-and-using-delegates-c-and-accessing-them-in-blueprints/9649.md?page=1)
