Why Am I Unable to Get Class of Parent Object From Line Trace by Channel?

I have several objects that are children of an object called “Item_Parent”. When the Line Trace hits something, I want it to check if the parent class is equal to Item_Parent. Here’s the relevant part of the blueprint that’s giving me issues:

It’s always returning false for any of the objects that are children of “Item_Parent”, but if I were to have it get the class of the child object and check if it’s equal to Item_Herb, it works properly, returning true only if I look at the Herb, and false if I look at any of the other children of Item_Parent.

You might be able to weed out the non “Item_parent” objects by casting the the hit actor to “Item_parent”. If the cast fails then it is not a an “Item_parent” child.

To figure out exactly what the class is you can just get the display name of the getclass or get the displayname of get parent actor returnvalue to figure out exactly what is going on.

Fantastic! Using cast to resolved my issue, though it is still weird that my solution didn’t work. I’ll have to try to get the display names at a later time to figure out what that’s all about. In the meantime, thank you for the solution!

Glad it works. So the reason why it does not work from what I understand from your question is that the hit actor is not an actual Item_Parent class actor. Item_Herb does inherit from Item_Parent but the Class itself is Item_Herb.