I have a global layout that serves as my GUI. Array and variables are of global type. There is an inventory of three places that is filled when an item is picked up. It works in such a way that it switches to the appropriate frame of the animation on which a certain item is displayed. When I switch to another layout, the item picked up in the previous layout disappears in those places. The function and array work fine. If I set these item slots to be global, then I get a copy of those slots at the beginning of the screen, which do not move with the camera, but are filled with right items.
I tried to put behavior persist on the item slots, I tried to use the pin for the main element of the GUI, but nothing helps. The slot is filled when an item is picked up. Would at the beginning of each layout somehow have to say that all the items picked up in the previous layout are reloaded into the slots in the new layout. I've been struggling with this for quite some time now.