Spawning objects and layers

New releases and general discussions.

Post » Mon Jan 04, 2010 9:23 pm

Hello construct community, this is my first post here and I am submitting it because I have found something I was not sure if you knew about. Well I am sure someone does... but onto my point. I have been making a side scrolling shooting game and in the past implemented parallax scrolling. It looked nice but at the time, I was a mere noob, and I assumed it had broken my shooting. Bullets would not spawn! This was quite the conundrum as you can understand, therefore I said "screw it" and went on my way with the essentials of game play. Well I decided to revisit the issue, maybe the bug had been fixed. Until I checked and it still did not work. "How could this be?" I said to myself. Until I had an idea. A metaphorical light bulb popped on and Wow did I feel stupid. When you add layers, the one your object spawns on is the same. I realized that it wasn't just the bullet objects, for my particles were gone as well. I toyed around with the layer effects and I noticed that my bullets were being morphed by the layer effects. This was quite strange I said to myself and thus concluded that by inserting the NAME of the layer into the field ( I did not realize at the time that it was defaulting to the NUMBER) since the number of the layer and the layer are the same. So I renamed it "Layer 1" and to my joy it worked.

tl-dr; Objects spawn on a different layer when you add more layers assuming that the first layer is the one you work on and you add layers later for effect. Look out for it not working.
Posts: 46
Reputation: 1,092

Post » Mon Jan 04, 2010 9:26 pm

Yep, layer 1 changes if you add a new layer at the bottom, so try to always use layer names.
Scirra Founder
Posts: 25,295
Reputation: 200,994

Post » Mon Jan 11, 2010 10:33 am

I think most of us have run in to this problem at least once in our days of Constructing. I know I have... even long after I understood how layers worked... sometimes you just forget when you are making stuff and don't notice it's missing at first, then later on you sit there scratching your head trying to figure out what went wrong only to discover you messed up you layers or something.

Common mistake, easily fixed ;)

Tired of crappy file hosts that are crappy? Get DROPBOX -
Posts: 3,032
Reputation: 30,999

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests