How to create objects automatically?

[size=150]How can I create objects automatically and with a established or random time? [/size]

[size=150]I need to create multiple pitchers of beer and make them to move forward on the platform every “x” seconds or in a random way.[/size]


[size=150]I tried with this… but nothing :frowning: help me pls! :cry: [/size]

The logic in the last screenshot seems right :confused:
But if you lost a beer (don’t make a click over it), there will be a beer flying indefinitely, the number of beers never will be 0, and no more beers will be created :wink:

Anyway it should works while you click all the beers, if it doesn’t work you could share your project (zip with resources), so we can check it :slight_smile:

EDIT: Oh, please don’t use big font sizes :wink:

Adding force to the beers should only be called once per beer. With no conditions on that force adding, the beers will all be vanished off-screen before you even see them.

If you want to spawn beers randomly, I suggest this.

Variable newbeer = 1; || Do = Random(3) + 1 to variable n; || Do = 0 to Variable newbeer

The timer spawntimer is greater than Variable n || Create object beer at 23:257 || Do = 1 to Variable newbeer

The Do = Random(3) + 1 to variable n; will be how decide often your beers spawn.

In fact, it can be done every frame if the “Damping” parameter is set to 0. :wink:

i don’t know how to apply this code :frowning: but here is my project

OK, the problem is that you create new beers in the layer “mesa2”, this is not a layer, set the layer to undefined and the beers will be created in the Base layer by default :slight_smile:
Maybe you did it because you can’t see the beers, just change the beers Z-Order after creating them :wink:

Solved! Thanks you so much :smiley: