GetChildrenComponents doesn't work in interface function implementation

Hello, everyone!

I’m using only Blueprints in my project.

I have the BPI_Translucent interface with one function SetTranslucency, which receives boolean parameter with new value of actor translucency and returns boolean Success.

You can see the implementation of this function in one of my blueprints, which implements this interface

The problem is that call to GetChildrenComponents of Floor Static Mesh Component return 1 or even 0 child components, but actually it isn’t

337911-s3.png

I’ve put all this nodes in another function inside my blueprint and it works, GetChildreComponents returns all children. It also works if I just call this function inside the implementation of SetTranslucency interface function.

So, why does the GetChildrenComponents function return not all child components when it is called inside the interface function implementation? And how can I fix it?

Thank you in advance!

did you try checking the box “include all descendants”?

try running “Get num children components” on your floor and see what number you get

also, you might be calling the implementation too early (like on begin play), try calling it when the actor is fully loaded into the map

I’ve tried “include all descendants”. This function I called on Trigger Begin/End Overlap.
And, what is the most interesting, GetNumChildrenComponents return actual number of child components, but not recursively, without children of child components.

oh it might be because you’re casting to static mesh and some of them are failing to cast

hook up a print string node right before the cast node and see how many times it fires

also, youre checking to see if it contains the word wall, but that might be case sensitive or something which would give you a false

The code is fully workable)
I’ve put all this nodes in another function MySetTranslucency inside my blueprint and it works, GetChildreComponents returns all children. It also works if I just call MySetTranslucency inside the implementation of SetTranslucency interface function. It’s a strange problem related to behavior of GetChildrenComponents in interface function implementation…

Sorry for my carelessness! I connected SetCollisionResponseInChannel nodes to Return Node in loop body. So, after first loop iteration it calls the return node.
The topic can be closed!