Problem Description
An object set as global on a layout will create duplicates of itself when revisiting that layout after saving and reloading the game from a different layout.
Attach a Capx
[attachment=0:zu1wp9i1][/attachment:zu1wp9i1]
Description of Capx
This capx has 2 layouts:
Layout 1 has 2 buttons for loading and saving.
Layout 2 has a global object (orange square sprite).
Steps to Reproduce Bug
- 1) Launch the game. You'll see Layout A. Counted object = 0.
- 2) Press Spacebar. You'll be switch to Layout B, and see the orange sprite (global object). Counted object = 1
- 3) Press Spacebar again. You'll be switch to Layout A. The orange sprite is still present. Counted object = 1
- 4) Press Save.
- 5) Close the game and restart it. The orange sprite is gone. Counted object = 0.
- 6) Press Load. The orange sprite is visible. Counted object = 1.
- 7) Press Spacebar. You'll be switched to Layout B. Counted object = 2.
- 8) You can repeat steps # 3 to 7 to create multiple copies of the global object.
Observed Result
The orange square global object is duplicated after loading the savefile and revisiting its layout.
Expected Result
The orange object is not duplicated after loading the savefile. No new copies of the object gets created.
Affected Browsers
- Chrome: YES
- FireFox: ???
- Internet Explorer: ???
Operating System and Service Pack
Windows 7
Construct 2 Version ID
Release 195 (64-bit) - Jan 19 2015