# Calling Blueprint Event from C++ code

**URL:** <https://forums.unrealengine.com/t/calling-blueprint-event-from-c-code/451568>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE4, CPP, Blueprint, question\
**Created:** [July 1, 2019, 10:26pm UTC](https://forums.unrealengine.com/t/calling-blueprint-event-from-c-code/451568 "2019-07-01T22:26:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fanto88](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fanto88](https://forums.unrealengine.com/u/Fanto88)\
**Post date:** [July 1, 2019, 10:26pm UTC](https://forums.unrealengine.com/t/calling-blueprint-event-from-c-code/451568/1 "2019-07-01T22:26:31Z")

</div>

Hi all,

i would like to call an event inside my HUD blueprint using C++.

So, basically, when the character take damage i want to remove some health from it and call the event UpdateHUD which redraw the hearts based on the health remaining. How can i achieve something like this?

```
float AScrollerGameCharacter::TakeDamage(float Damage, FDamageEvent const& DamageEvent, AController* EventInstigator, AActor* DamageCauser)
{
	this->Health--;
	return Damage;
}

```

 ![281270-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/4/ce48fc92d35d6c7d59c65c5b3dc63f4123c272c1.png)

---

<div class="post-metadata">

**Author:** ![SupDeity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupDeity](https://forums.unrealengine.com/u/SupDeity)\
**Post date:** [July 2, 2019, 5:23am UTC](https://forums.unrealengine.com/t/calling-blueprint-event-from-c-code/451568/2 "2019-07-02T05:23:34Z")

</div>

i dont think you can call blueprint event from c++. the opposite is easy but i dont think there is even documentation about this.

---

<div class="post-metadata">

**Author:** ![GarnerP57](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GarnerP57](https://forums.unrealengine.com/u/GarnerP57)\
**Post date:** [July 2, 2019, 7:32am UTC](https://forums.unrealengine.com/t/calling-blueprint-event-from-c-code/451568/3 "2019-07-02T07:32:41Z")

</div>

It can be done but is a hack more than a solution. You should instead make a Blueprint Implementable or Native Event.

---

<div class="post-metadata">

**Author:** ![Fanto88](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fanto88](https://forums.unrealengine.com/u/Fanto88)\
**Post date:** [July 2, 2019, 1:16pm UTC](https://forums.unrealengine.com/t/calling-blueprint-event-from-c-code/451568/4 "2019-07-02T13:16:36Z")

</div>

So… i’ve made some edits:

```
	UFUNCTION(BlueprintImplementableEvent)
		void UpdateHud();

```

Inside the Widget C++ parent class, and now i can correctly see the Event UpdateHud inside the UMG blueprint of the widget. But how can i call that event from another c++ class?

---

<div class="post-metadata">

**Author:** ![Fanto88](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fanto88](https://forums.unrealengine.com/u/Fanto88)\
**Post date:** [July 2, 2019, 2:20pm UTC](https://forums.unrealengine.com/t/calling-blueprint-event-from-c-code/451568/5 "2019-07-02T14:20:10Z")

</div>

Nevermind, seems like i’ve fixed it with:

Inside the .h file:

```
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = PlayerWidget)
class UScrollerGameWidget* Widget;

```

Inside the .cpp file:

```
	this->Widget->RedrawHud();
```

---

<div class="post-metadata">

**Author:** ![Fanto88](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fanto88](https://forums.unrealengine.com/u/Fanto88)\
**Post date:** [July 9, 2019, 11:02am UTC](https://forums.unrealengine.com/t/calling-blueprint-event-from-c-code/451568/6 "2019-07-09T11:02:54Z")

</div>

Nevermind, seems like i’ve fixed it with:

Inside the .h file:

```
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = PlayerWidget)
class UScrollerGameWidget* Widget;

```

Inside the .cpp file:

```
	this->Widget->RedrawHud();
```
