# Get hit child actor

**URL:** <https://forums.unrealengine.com/t/get-hit-child-actor/434477>\
**Category:** Blueprint\
**Tags:** child-actors, overlap-actors, unreal-engine, Blueprint, question\
**Created:** [September 25, 2018, 4:30pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477 "2018-09-25T16:30:41Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [September 25, 2018, 4:30pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/1 "2018-09-25T16:30:41Z")

</div>

Hello all, try find information how to get child actor when it hit or overlap. I have actor (master\_enemy) and I create child class. I want get chid actor when this actor get hit, how I can do it?

 ![254696-child.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/5/79528c32e8de1d03d57b900ddd29a71855cc50a0.png)

---

<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:** [September 25, 2018, 4:49pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/2 "2018-09-25T16:49:54Z")

</div>

Cast to the child class instead.

---

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [September 25, 2018, 5:42pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/3 "2018-09-25T17:42:08Z")

</div>

how? If I will use 1000 child class?

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [September 25, 2018, 5:44pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/4 "2018-09-25T17:44:34Z")

</div>

If you need to test against something, you can make the 1000 child classes implement a certain BP Interface and Branch on [Implements Interface].  
OR you can have an Enum variable in the default settings in the parent class, and then each Child class can have their default of that Enum set to a different value and you can Branch on that without having to Cast to a child class to get it.

---

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [September 25, 2018, 5:49pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/5 "2018-09-25T17:49:32Z")

</div>

I correctly understand? It is solution for this problem? check all children in class??

 ![254698-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/f/4/7f46450c6bad25221944d9e2c86bea81127ecad6.png)

---

<div class="post-metadata">

**Author:** ![mightyenigma](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mightyenigma](https://forums.unrealengine.com/u/mightyenigma)\
**Post date:** [September 25, 2018, 6:01pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/6 "2018-09-25T18:01:13Z")

</div>

No. I mean use an interface, or a parent class variable set to a certain default value on each child class and test against that, instead of testing which child class it is. That way you only need to check one thing and it will work on all child classes.

---

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [September 25, 2018, 6:13pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/7 "2018-09-25T18:13:25Z")

</div>

Nightyenigma, thank you for support, can you send example? about " or a parent class variable set to a certain default value", can not understand how I should do(

---

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [September 25, 2018, 7:08pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/8 "2018-09-25T19:08:17Z")

</div>

My solution is, but via interface all work too.

![254700-untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/c/8cc1c7c163b0e5fe70f2834e8ce9250ef8d0b0c4.png)

---

<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:** [September 25, 2018, 7:13pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/9 "2018-09-25T19:13:43Z")

</div>

As mightyenigma suggested, if you want to have 1000 child classes (why?!), you may need an interface:

> **[Blueprint Interface](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Types/Interface/)**
>
> Blueprints that declare functions to define an interface between Blueprints.

Do note it takes while to wrap one’s head around them.

* * *

Depending on what you’re trying to do as you did not explain what purpose it serves, why not create a function or event in the parent and have the child override it.

---

<div class="post-metadata">

**Author:** ![D.Shchepetkov](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/d.shchepetkov/32/467366_2.png) [@D.Shchepetkov](https://forums.unrealengine.com/u/D.Shchepetkov)\
**Post date:** [September 25, 2018, 7:23pm UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/10 "2018-09-25T19:23:02Z")

</div>

Thank man, I alray test it, work fine!)

---

<div class="post-metadata">

**Author:** ![GurneyHM02](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gurneyhm02/32/971593_2.png) [@GurneyHM02](https://forums.unrealengine.com/u/GurneyHM02)\
**Post date:** [August 8, 2024, 2:20am UTC](https://forums.unrealengine.com/t/get-hit-child-actor/434477/11 "2024-08-08T02:20:50Z")

</div>

This was the simple solution for me. Thanks.
