I've got bitten by a behaviour related to Global Layers and Global Objects and I wanted to open a discussion about understanding how these two work, especially in conjunction with each other.
My case is about making a GUI. In its simplest form, the GUI has a 'frame' and has 'buttons'. The 'buttons' are Pinned to the 'frame' and the 'frame' animates up and down; the 'buttons' being pinned, follow the 'frame'.
As recommended by the manual for GUIs, I make my GUI layer Global, and set things like Parallax, Transparency, etc, so that the layer settings carry itself to other layouts. The problem that arose, however, was that Objects inside the Layer were getting destroyed, and then recreated again. And that's a problem because all the Pinning setup I did at the start of the layout is broken because the Pinned UIDs all changed.
Then I tried making the Objects Global, too. But that wasn't correct either, because the objects started doubling up. The Global Layer kept on creating its objects, assuming that the objects that was on that layer was going to be destroyed, but they weren't, because they were Global.
So I switched off Global Layers altogether and manage everything as Global Objects.
However, this behaviour is a bit counter-intuitive for one reason. If Global Layers were going to recreate the Objects on the new layout, why destroy them in the first place?
(A.) I think it would have been better to separate the 2 features of propagating layer settings separate vs 'propagating' objects through layouts. In this way it is apparent to the user what is being 'persisted' in a Global Layer.
(B.) Like I said above, if Global Layers were intended to retain Objects then it is expected that those actual objects are considered global, in the same sense that Global Objects are global; they are not destroyed, and whatever parametric options attached to them are unchanged.
I could have lived without (B), but because of (A) Global Layers have suddenly become unworkable; I can't even use them for unifying Layer settings because the Global Layer wants to keep on recreating its objects. I can't turn off that behaviour.
However, if I'm missing something here, I'd appreciate any thoughts.
Thanks.