I have a problem: I want o hide an actor that has many Child Actor Components, but simple ‘Set Actor Hidden In Game’ unfortunately doesn’t work. So as a workaround I store references to all child actor components in array and when needed, call Set Hidden In Game for every child actor in ForEach loop. This works, but lags a lot when many actors try to hide.
The child actor components are parented (AttachToComponent) to one of the components, so I’ve also tried hiding this parent component - but without any luck. Maybe it’s some bug? I thought that if we hide parent component, then all child components will hide too…
Is there a way to somehow hide/show all these child actor components without needing to go through lll of them in ForEach loop?
I have made some tests here and i was able to hide an actor with some child actors components using the follow setup, it has been made on level blueprint just for tests purposes.
Thanks @iorek01, ‘Set Visibility’ of Default Scene Root instead of Set Hidden In Game works! Even if ‘Set Visibility’ is oficially meant to be used only for in-editor visibility, which is strange
Tip: For child actors added in Contruction Script via ‘Add Child Actor Component’ node, child actors must be attached to the component that we use ‘Set Visibility’ on.
Edit: This is without using ForEach and it practically answers my question, but it still lags Probably because it still goes through all children just like ForEach loop.