Hello! I'm having issues with a series of events that check an Instance Variable. Basically, for an endless runner type of game, I'm spawning objects at random locations along a path so long as that object isn't already on screen.
To do this, I'm checking an Instance Variable named "Active" for an object, and if the variable is 0 (which is its default setting), spawning the object and then setting its variable to 1. When the object is later destroyed, its variable is set back to 0. Here's what the event sheet looks like at the moment:
<img src="http://i216.photobucket.com/albums/cc212/darkstorne/Long_zpsa18dfbb2.png" border="0" />
It doesn't work. None of the background objects (that require Instance Variable checking) spawn. The foreground objects work perfectly.
Disabling this didn't change anything. Still no background objects spawned:
<img src="http://i216.photobucket.com/albums/cc212/darkstorne/Short1_zpsbfc3063e.png" border="0" />
But disabling this does allow the background objects to spawn. However, it spawns loads of them, since there's nothing to tell C2 to stop spawning the objects:
<img src="http://i216.photobucket.com/albums/cc212/darkstorne/Short2_zps8e7c9675.png" border="0" />
Finally worth noting - I had originally tried setting the events up like this (using a sub event), but this doesn't spawn any background objects either:
<img src="http://i216.photobucket.com/albums/cc212/darkstorne/Short3_zpse868e47a.png" border="0" />
Sorry for using so many images, but I wanted to be as thorough as possible so you know what I've tried <img src="smileys/smiley1.gif" border="0" align="middle" /> Any idea where I'm going wrong?
Many thanks for reading <img src="smileys/smiley12.gif" border="0" align="middle" />