# Creating an event to be fired from C++

**URL:** <https://forums.unrealengine.com/t/creating-an-event-to-be-fired-from-c/316819>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, CPP, question\
**Created:** [April 29, 2015, 11:11am UTC](https://forums.unrealengine.com/t/creating-an-event-to-be-fired-from-c/316819 "2015-04-29T11:11:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_30bf735b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_30bf735b](https://forums.unrealengine.com/u/anonymous_user_30bf735b)\
**Post date:** [April 29, 2015, 11:11am UTC](https://forums.unrealengine.com/t/creating-an-event-to-be-fired-from-c/316819/1 "2015-04-29T11:11:19Z")

</div>

Hello All,

I have been looking all over the web for the answer to this one but I’m getting confused and I don’t think some of the examples I found specifically show me what I need, so here is what I need help with.

I have C++ class that handles my TCPNetworking, When I get a response from the network I want to Fire and event from C++ so that my blueprint will act.

Example:

1. Blueprint calls function in C++ to send login information to the server (working)
2. Blueprint now waits for the response (working)
3. **When the C++ receives the message back from the server I would like to fire an event in Blueprint from C++ to continue with the login process.**

Cheers

---

<div class="post-metadata">

**Author:** ![Evols](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Evols](https://forums.unrealengine.com/u/Evols)\
**Post date:** [April 29, 2015, 11:43am UTC](https://forums.unrealengine.com/t/creating-an-event-to-be-fired-from-c/316819/2 "2015-04-29T11:43:22Z")

</div>

Use the BlueprintImplentableEvent !  
Create a member function in your class using:

```
UFUNCTION(BlueprintImplentableEvent, category = "YourCategory")
void MyEvent(/* Params*/);

```

Then, in your BP graph, search for your event’s name, to place it in the graph.  
And when you call this function in your C++ code, it will call the Event in BP !

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_30bf735b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_30bf735b](https://forums.unrealengine.com/u/anonymous_user_30bf735b)\
**Post date:** [April 29, 2015, 11:45am UTC](https://forums.unrealengine.com/t/creating-an-event-to-be-fired-from-c/316819/3 "2015-04-29T11:45:51Z")

</div>

After posting I found a possible solution, Typical really.  
Here is the link to the solution I got working.

[https://answers.unrealengine.com/questions/31728/invoking-event-in-blueprint.html](https://answers.unrealengine.com/questions/31728/invoking-event-in-blueprint.html)

Is this the recommended way? I appreciate this is only local to the class and will not allow the event to fire in all blueprints.

If anyone has further input that would be appreciated.

Thanks GrendelsMom,

---

<div class="post-metadata">

**Author:** ![Evols](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Evols](https://forums.unrealengine.com/u/Evols)\
**Post date:** [April 29, 2015, 12:13pm UTC](https://forums.unrealengine.com/t/creating-an-event-to-be-fired-from-c/316819/4 "2015-04-29T12:13:24Z")

</div>

The BlueprintImplentableEvent way is more recommended, for what you are doing (see my answer for more informations).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_30bf735b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_30bf735b](https://forums.unrealengine.com/u/anonymous_user_30bf735b)\
**Post date:** [May 1, 2015, 8:18am UTC](https://forums.unrealengine.com/t/creating-an-event-to-be-fired-from-c/316819/5 "2015-05-01T08:18:13Z")

</div>

Thanks for the comments,  
I couldn’t get the event into a seperate blueprint so I used the following method.

```
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FLoginResponseDelegate, bool, authenticated);

```

and its delegate

```
UPROPERTY(BlueprintAssignable, Category = "NDG Events")
		FLoginResponseDelegate OnLogonResponseDelegate;

```

Then called this with

```
OnLogonResponseDelegate.Broadcast(authenticated == 1 ? true : false);

```

This now allows me to just broadcast the message so any blueprint binding to this event will be fired which is perfect.

Note:  
The authenticated in the Broadcast is 1 as this is returned via my server as a single bit received in the TCP packet.

Thanks for the assist and I appreciate the extra advice on using **BlueprintImplentableEvent** this will be required in later classes.

---

<div class="post-metadata">

**Author:** ![RHZhang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RHZhang](https://forums.unrealengine.com/u/RHZhang)\
**Post date:** [April 23, 2018, 10:16am UTC](https://forums.unrealengine.com/t/creating-an-event-to-be-fired-from-c/316819/6 "2018-04-23T10:16:01Z")

</div>

Hello, what do you think is the drawback if we use delegate (BlueprintAssignable) instead of function (BlueprintImplentableEvent)?
