I have a problem with components which are constructed from other components constructor.
My first compoenent (cockpit) derives from SceneCompoenent. From it’s constructor I create Cockpit Buttons, which derive from StaticMeshComponent. The effect is like this:
but it should be like this:
The second situation can be achieved after the Blueprint is recompiled, but:
It must be recompiled every time the UE is started.
When there are more buttons (i.e. 15 or more), component nesting brakes decisively and recompiling does not help anymore.
How can I ‘rearrange’ the components? They should be arranged like on the second screen, because the buttons are connected to the cockpit with ‘SetupAttachment()’ function.
You can rearrange them if they are added in a parent blueprint.
If they are in C++ you have to attach them exactly as you say you do with SetupAttachment ()
Check your actor’s constructor. Make sure that SetupAttachment is called only once per component and that the right scene component is set as a parent. It is obvious that you already have some structure, you just have to double check it.