Okay. So in your BP logic I immediately spot the problem, which is that first you ask if the Item is a BP Actor. If it succeeds, gets child components. And it does succeed the first time, because that’s the Item. But then the same question is asked to each child, in this case scene components; cast as BP Actor -> fails, return empty array. So with that logic a scene component will never return a child.
Instead of returning an empty array if the BP Actor cast fails, instead ask another question. You know it’s not the BP Actor class, so now cast the item as a scene component. If that succeeds, get its children and return them. If it does not have any children, it will return 0.
It’s when all things fail, that you need to return an empty array. And in your case a print string to inform about the error, because that should never happen.
As for using an interface for this, it is possible yes but I don’t really know if I would go with that or not.
What you would have to do with the interface is to have an Object input and an array of object outputs (the children).
Then, you’d have to add a query for each possible object.
- Does Object == BP Actor [self]? if true, return these manually selected children.
if false - Does Object == Box0 [That scene component]? if true, return these manually selected children.
If false - Does object == Box1 [That scene component]?
etc…
It’s not scaleable, and would have to be done in each of the classes that implements the interface.