# How to make this hit and get hit function to work together?

**URL:** <https://forums.unrealengine.com/t/how-to-make-this-hit-and-get-hit-function-to-work-together/483993>\
**Category:** Cinematics & Media\
**Tags:** combat, unreal-engine, hit, question\
**Created:** [May 27, 2021, 2:16pm UTC](https://forums.unrealengine.com/t/how-to-make-this-hit-and-get-hit-function-to-work-together/483993 "2021-05-27T14:16:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivory\_Angel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivory\_Angel](https://forums.unrealengine.com/u/Ivory_Angel)\
**Post date:** [May 27, 2021, 2:16pm UTC](https://forums.unrealengine.com/t/how-to-make-this-hit-and-get-hit-function-to-work-together/483993/1 "2021-05-27T14:16:06Z")

</div>

Hi guys!

I’ve been following a tutorial on how to create a combat system and it’s been working really good though I wanted to implement an extra function to make my screen go red when I get hit by an enemy.

The problem is the following:

When I connect the “Get Hit” to the Cast to it is indeed making the enemy die after a certain amount of hits OR it is making my screen go red and allows the enemy to kill me after a certain amount of hits, but I cannot make them work together nor connect them somehow. I’m quite new to unreal engine, so I’m still trying to understand how to make them work in my project if I can only connect one at the time.

 ![339972-imagen-2021-05-27-090538.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/2/b/22ba71e1cba44c8c4cca491096b1add76d00d65d.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 27, 2021, 2:21pm UTC](https://forums.unrealengine.com/t/how-to-make-this-hit-and-get-hit-function-to-work-together/483993/2 "2021-05-27T14:21:06Z")

</div>

You want AND instead of OR?

You can just chain them together, or use a sequence node.

I think I’m missing something here…

---

<div class="post-metadata">

**Author:** ![Ivory\_Angel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivory\_Angel](https://forums.unrealengine.com/u/Ivory_Angel)\
**Post date:** [May 27, 2021, 2:35pm UTC](https://forums.unrealengine.com/t/how-to-make-this-hit-and-get-hit-function-to-work-together/483993/3 "2021-05-27T14:35:33Z")

</div>

Yes, I want, AND to happen… I want to see the screen turn red when I get hit, but I also want to be able to hit the enemy and kill him. For now I can do one or the other with the cast to that are there in the screenshot

---

<div class="post-metadata">

**Author:** ![Ivory\_Angel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivory\_Angel](https://forums.unrealengine.com/u/Ivory_Angel)\
**Post date:** [May 27, 2021, 3:13pm UTC](https://forums.unrealengine.com/t/how-to-make-this-hit-and-get-hit-function-to-work-together/483993/4 "2021-05-27T15:13:21Z")

</div>

I already tried with a sequence, and when I hit first it damages the enemy but then with the same hit I hurt myself. so it doesn’t work

when I plug the top Cast to, 1 of the events work fine… and when I connect the bottom cast to then only the 2 event works

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 27, 2021, 4:22pm UTC](https://forums.unrealengine.com/t/how-to-make-this-hit-and-get-hit-function-to-work-together/483993/5 "2021-05-27T16:22:43Z")

</div>

Ok, you need the code in you AND your enemy.

When you get hit, you should get the red screen and health deducted.

Your enemy can just have the health deducted, because you won’t know what they’re experiencing apart from that.
