# Problems dealing with damage

**URL:** <https://forums.unrealengine.com/t/problems-dealing-with-damage/449674>\
**Category:** AI\
**Tags:** damage-sense, unreal-engine, UE4, Blueprint, question\
**Created:** [May 28, 2019, 11:13am UTC](https://forums.unrealengine.com/t/problems-dealing-with-damage/449674 "2019-05-28T11:13:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![F2BEAR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@F2BEAR](https://forums.unrealengine.com/u/F2BEAR)\
**Post date:** [May 28, 2019, 11:13am UTC](https://forums.unrealengine.com/t/problems-dealing-with-damage/449674/1 "2019-05-28T11:13:56Z")

</div>

Hi everyone.  
I’m currently starting using UE4 without previous knowledge of videogame development.  
Now i’m trying to apply damage to an AI and for some reason Im not able to receive on the AI.  
Here are some screenshots of what i’ve done.  
The AI LifeBar widget:

 ![278145-screenshot-61.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/8/028915cfae9a80e093a5b40a8d70e8477e4b577e.png)

The any damage event on the AI blueprint:

 ![278146-screenshot-62.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/f/36f1f2de0545223e9ab7a68dd90df549c25fcece.png)

The apply Damage event:

 ![278147-screenshot-63.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/7/1b750ec116786dd4631d9cdb82d59b017ba39916.png)

And finally a screenshot of the game, printing the damage i’m making:

 ![278149-screenshot-64.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/3/c/03c41f1e62430e87258e554dea98f3ad3c45833f.png)

I would be very glad if someone can help me to solve this.

---

<div class="post-metadata">

**Author:** ![Lardo\_Deepdelver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lardo\_Deepdelver](https://forums.unrealengine.com/u/Lardo_Deepdelver)\
**Post date:** [May 29, 2019, 1:27pm UTC](https://forums.unrealengine.com/t/problems-dealing-with-damage/449674/2 "2019-05-29T13:27:37Z")

</div>

get all actors of class for the health bar makes no sense  
that would only work if you only have one enemy actor at all times, you need to somehow get the character the health bar is attached to.

Assuming it’s a widget created by a UWidgetComponent you can create a function that gets the owner which is called on your AICharacter on begin play.
