Get hit child actor

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?

Cast to the child class instead.

how? If I will use 1000 child class?

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.

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

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.

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(

My solution is, but via interface all work too.

254700-untitled.png

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

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.

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

This was the simple solution for me. Thanks.