Global object duplicating between layouts

Get help using Construct 2

Post » Fri Nov 25, 2016 10:53 am

Hello,

I dont know if I have to post here this, but I suppose I am doing something wrong.

I have 2 global objects (9-patch and text) that are always on screen with opacity 0 in a UI layer. When I have to display some text I set its opacity to 100 and show the text. This objects are created in the first layout, and its layer (UI) is also global, to override it every layout.

The problem is that every new layout, a new instance of both objects are created, so I lose the reference to the first object IID. And I only want one copy of them.

Why is this happening?

Edit:
I have just tried to turn UI layer to "no global", and seems to work fine. So, my question now is, a global layer, duplicates its content every layout?

Edit 2:
Ok, I think i figured it out how it works.

-A global layer with "no global" objects, destroy its objects at the end of a layout and create new ones with new UIDs at the start of the next layout
- A global object, persist with the same UID between layouts

- A global object in a global layer persist between layouts with the same UID and also, a new instance of the same global object is created because of the global layer. Is this correct?
B
6
S
2
Posts: 61
Reputation: 1,099

Post » Fri Nov 25, 2016 9:15 pm

Any object in a global layer is global so you don't need to also make the object global. If you do this, it keeps the global object between layouts and then creates everything from the global layer as well.
B
47
S
17
G
81
Posts: 2,224
Reputation: 48,095


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests