# How Do I use Hit Event to Make an If/Else Collision?

**URL:** <https://forums.unrealengine.com/t/how-do-i-use-hit-event-to-make-an-if-else-collision/414470>\
**Category:** World Creation\
**Tags:** child-class, parent-class, unreal-engine, hit-event, Collision, question\
**Created:** [January 13, 2018, 2:59pm UTC](https://forums.unrealengine.com/t/how-do-i-use-hit-event-to-make-an-if-else-collision/414470 "2018-01-13T14:59:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![KennDamon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KennDamon](https://forums.unrealengine.com/u/KennDamon)\
**Post date:** [January 13, 2018, 2:59pm UTC](https://forums.unrealengine.com/t/how-do-i-use-hit-event-to-make-an-if-else-collision/414470/1 "2018-01-13T14:59:48Z")

</div>

![226907-screenshot-63.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/5/a355db2435d8df0cba72bc62db997abe168cef33.png)

```
I'm pretty new to Unreal 4, and I'm trying to make it so when, on this FPS template, when i shoot the object, it turns red, and when the character touches it, it turns green. For whatever reason, the blueprint will only take one hit event, and when I tried making a child class, it inherited everything else, except it overrides the collision so it turns green, but doesn't turn red. The only thing I can faintly visualize is making an if/else structure, but I'm not sure how to go about that in Unreal 4. Could someone please help me find out what I'm doing wrong?
```

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 13, 2018, 3:15pm UTC](https://forums.unrealengine.com/t/how-do-i-use-hit-event-to-make-an-if-else-collision/414470/2 "2018-01-13T15:15:15Z")

</div>

_If / Else_ is called Branch in UE4 and you’re most likely looking for something like this:

 ![226900-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/0/56079f412bd272ab4ab6b95d4a3ac42275efa4a6.png)

edit: in your case I think _other_ returns the actor reference. There’s a bit of inconsistency in the naming conventions here and there.

---

<div class="post-metadata">

**Author:** ![KennDamon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KennDamon](https://forums.unrealengine.com/u/KennDamon)\
**Post date:** [January 13, 2018, 3:19pm UTC](https://forums.unrealengine.com/t/how-do-i-use-hit-event-to-make-an-if-else-collision/414470/3 "2018-01-13T15:19:15Z")

</div>

I can’t connect get player character with ==. It says ‘cannot use enum qualiity operators on anything but enums’.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 13, 2018, 3:20pm UTC](https://forums.unrealengine.com/t/how-do-i-use-hit-event-to-make-an-if-else-collision/414470/4 "2018-01-13T15:20:14Z")

</div>

Do not use enums for this. You want to compare actors (objects - yet another inconsistency 😉 ) instead - drag a wire off other and search for ==

---

<div class="post-metadata">

**Author:** ![KennDamon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KennDamon](https://forums.unrealengine.com/u/KennDamon)\
**Post date:** [January 13, 2018, 7:23pm UTC](https://forums.unrealengine.com/t/how-do-i-use-hit-event-to-make-an-if-else-collision/414470/5 "2018-01-13T19:23:53Z")

</div>

I did. It gave me all kinds of ==. I don’t know which one to use.

---

<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:** [January 13, 2018, 9:59pm UTC](https://forums.unrealengine.com/t/how-do-i-use-hit-event-to-make-an-if-else-collision/414470/6 "2018-01-13T21:59:12Z")

</div>

Make sure you got a check-mark in “Context sensitive” and it will filter irrelevant things out for you.

The one you are looking for is “Equal (Object)”.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 14, 2018, 9:45am UTC](https://forums.unrealengine.com/t/how-do-i-use-hit-event-to-make-an-if-else-collision/414470/7 "2018-01-14T09:45:04Z")

</div>

There is only one:

![226950-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/8/a/d8a702e09a529e829c544c5357ffab06da8a8de8.png)
