Spawning objects and layers

This forum is currently in read-only mode.
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • 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.

  • Yep, layer 1 changes if you add a new layer at the bottom, so try to always use layer names.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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


Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)