I want my sprite to spawn another sprite at a certain position. The problem is that if you create an invisible sprite at that location and make it so that the sprite spawns to other sprite on collision whit or overlapping offset whit the invisible sprite the sprite will spawn the another sprite infinitly. I want to only be able to have one of the spawn object in the game at the time. I tried making events that would do that.
I created a instance variable called Amount and tried making it so when too much sprites would be on screen they would get destroyed. The problem is that all versions of the sprite get destroyed when the amount is reached not just the last spawned one. It mamkes the sprite not spawn anything. Is there a way make it os only a certain amount of one sprite can be in the game at once otherwise no more can be spawned?