[Solved] How do I make Objects spawn appart from each other/How can I set a limit for Objects creation action?

I’m currently working on a sort of Procedural Generation for my Game. There are two problems right now: First I use the create action with Random Numbers:


But I dont know how to make the Walls spawn appart from each other, and how I can set a Limit so that they don’t spawn endlesly.
This is how it looks now:

By the way I’m trying to create a Backrooms parody game.
Any Idea could help!

Im still learning how to use the engine so the answer might be really easy

Your event is unconditional, so it is performed every single frame (around 60 times per second). Hence the rapid mess :smiley:

I suggest you check out the Wiki (link in the right side of the bar at the top), in particular events → repeat events. That should help with limiting the number of wall tiles created.

To prevent the tiles from overlapping, create a new sprite named WallSpawnCheck, and set it’s animation to the same image as the wall sprite. Then keep generating the WallSpawrCheck object until it no longer collides with a Wall object, and place a Wall object at eh same position as the WallSpawnCheck object.

Like this :

Thx man, you saved me days of work!