Please help me solve

What do you mean by reset timer?

I would like enemy waves to spawn every 5 seconds… I can’t get it to work

An entire wave every 5 seconds? Do you want all of the wave spawned at once?

You could use a timer to change the wave and a timer to spawn them unless they’re being spawned all at once to different positions.

To spawn them all at once you could use a While event.

Using the timer

When elapsed time > 5 seconds
Set the remaining value

While remaining > 0
… Spawn an object at a random location
… Decrease the remaining variable

Restart the timer

Be careful with the while event. If remaining doesn’t reach zero, it can cause an infinite loop. Just make sure to decrease the remaining count inside the event.


I don’t know if I explained myself well.
I would like what happens in this event to be managed autonomously with the timer without having to push the button.
It seems silly but I’m going crazy.
If I set a timer, only one enemy is created

Because you aren’t looping to create more enemies:

so i have to use “while condition”?
could you please show me where I’m going wrong?

yes, you need a loop to create more than one enemy. In this case a while with condition “remaining > 0” is appropriate.
inside the loop a. spawn your next enemy from the array (or whatever struct)
b. reduce the var “remaining - 1”

I’m not very familiar with this action… kindly follow the wetransfer above and you will find the project link
can you show me how to do it
please

add a new condition with the plus symbol, choose “while”
then customize it

1 Like

If you’re just trying to replace the button then you can remove the button condition and replace it with another timer

if elapsed > 5 of Wavetimer
restart waveTimer
Start/reset spawn timer

Just be sure to start the Wavetimer at some point like at the beginning.

Another option would be to restart the wave or wave timer after the remaining variable is 0. As the waves take longer to spawn, IDK if 5 seconds is enough time to spawn them all. You might want to wait until after all objects are swawned to restart the timer. If that’s the case make sure you use a trigger once on the 1st timer. And then restart it when the Remaining=0. This would insert a delay between waves.

1 Like

I tried adding a timer but this is what happens.
I put 5 seconds in the timer just to test if it works then obviously I will extend the time between one wave and the other.


Registrazione-2025-03-24-220555

I think this is roughly what @Keith_1357 was suggesting:

Spawner

Created with these events:

Does that do what you’re after?

1 Like

oh god why don’t i get the same result?
yes that’s what i’m trying to do


aaa

You are, but you’re spawning the enemies on top of each other, and you only see the last one spawned. Notice how my “create enemy” action adds an x & y randomness to the spawn point, so there’s less overlap:

image

1 Like

ah ok they were overlapping thank you very much to everyone for your availability and patience

1 Like