Setting visibility in child blueprint does not work

Hello Forum,

I have a parent BP with no components attached inside (only empty SM root), however it has a set of functions that will operate on them. I then create a child of this BP from the editor and attach static mesh components in the component editor inside the child BP. Only these children BP are active in the scene.

Parent BP:
1

Child BP:
2

The parent BP is toggling visibility in the construction script (so that only 1 static mesh component is visible) when I drag and drop the child BP in the scene.

The problem is that sometime I want to override what is visible directly in the child BP - for further manual editing INSIDE the BP’s viewport (I don’t care what’s visible in the scene a this moment) by toggling the “Visible” checkbox under Rendering, however it does not do anything and I see only the static mesh component that is set visible at the time of construction.

Even if I disconnect the call of the parent’s construction script in the child BP, nothing changes.
3

Does anyone know why this is happening?

Thank you for your time

1 Like

What happens if you disconnect the visibility setting in the parents construction script? So essentially disable anything that’s happening in any construction script just to see if you get the behavior you want.

When I disable the construction script in the parent BP, everything works as intended - I can see all the static meshes at once in the child BP and toggle visibility.

Is there a way to do this but without disconnecting the construction script in the parent’s BP every time I want to edit the static mesh components in the child BP? Ideally I only want to touch the child BP. Maybe I can modify the parent BP somehow?

I’m not convinced you’ll be able to “have your cake and eat it too” on this one as the construction scripts have semi-special behavior in the context of blueprints and the editor. As you just noticed, even though the child is not running the parent constructor explicitly it still gets run. I imagine your set visibility has “Propagate to children” checked which of course means that the construction script and editor will fight each other…and in your case the parent construction script is winning.

Is there a need to set the visibility within the construction script? Is that not something you can just do on beginplay? This will allow you to freely toggle visibility within editor but have the gameplay only show what is needed.

2 Likes

Sadly, I need this BP to function in the editor outside the game play. I guess there is nothing I can do about it for now.

Thank you very much for your input.

EDIT:
I added a bool variable to the parent’s construction script (whether it should run or not), which I then toggle in the child BP temporarily while editing the child’s BP viewport. I had to display inherited variables in the child BP, which also shows a bunch of other public/protected variables - not ideal, but not the worst of trade-offs :laughing:

Cheers!