So I'm having a bizarre issue, and I've been scratching my head over it for two days now.
Switching between certain layouts seems to bring sprites from the previous layout into the new one.
Here's a quick video showing the objects piling up when switching back and forth (sorry the levels look so similar, I just want to fix this before making new ones!). You can see the layout name and the object count in the top left, and as I switch between them the objects increase. Level_02 starts with 375, for example, and ends with 751.
What I've tried:
• Checked if layers are global. Nope.
• Turned on and off each block of code and re-tested. Deleted most of the code. Nada.
• Created a new layout from scratch (instead of simply duplicating the first one). Problem still exists, but read on ...
Steps to reproduce / Leads:
Weirdly, if I start the game on Level_01_Docks, then switch to others, I get the bug / duplication. If, however, I start the game on Level_02, or Level_03, and switch between them, it's fine. Going from either of them BACK to Level_01_Docks triggers the bug again. So I figure it's something to do with the layout Level_01_Docks, but for the life of me, I can't figure out what it is. The layouts Level_02 and Level_03 were created from scratch, as duplicating Level_01_Docks and renaming it still triggered the bug if you switch to it, no matter what the name is.
I've never had this happen before and it's driving me a little nuts. I've stripped the project back to just 158 lines of code. Here's my project file on DB:
You can switch back and forth between layouts by holding CTRL and pressing "," (previous) or "." (next).
If anyone could take a look at this for me, it would be greatly, muchly appreciated! I assume it's something simple and stupid I've overlooked, but I've had my face to the monitor for too long and my eyes are becoming big pixels. _