My repeat event doesn't go multiple times

my repeat action is only firing of 10 times then just stops and doesn’t fire off again

The trigger once conditions should be after your variable conditions, otherwise it will only ever trigger once regardless of the value of the variable. I think it’s allowing the events to trigger during the entire first time through the repeat because it’s within the repeat. Things behave differently inside loops especially trigger once

In this case, I’m not sure if it’s even needed.

If you want to create 5 objects on each side, you could use repeat 5 times and use the 2 add objects without the variable check and create 1 on each side per repeat iteration.

If you want 10 enemies on completely random sides, you could use

add object at Random(1)*1278; RandomInRange(0,714)

The random(1) would be 0 or 1
(0*1278 or 1*1278)

The “repeat” event will only do this x (in your case 10) times the whole time, it kind of is like a trigger once, but for the # of times you indicate. What you could do to have it repeat multiple times is set a variable like “repeatnow” when it = false , it won’t repeat, but when it sets to true, the repeat 10 times will happen. So as an example, lets say everytime the character nears a vehicle, you want to do the “repeat action” set it so when charcter < 300 pixel Vehicle, set repeat now to true. Then, within your repeat now, have a check for another variable, such as “repeatnow_off” and add 1 to it in your repeat now action. When repeatnow_off=10, then switch repeatnow to false, so it resets the variable. I hope that makes sense, and if I understood your question correctly, may help you with some ideas to get what you want going :slight_smile:

2 Likes

I agree. Once you move or remove the trigger once it’s going to create a wave of 10 enemies on every frame unless there’s another condition.

I did that with a Donkey Kong clone I was trying to make. It filled up with hundreds of barrels in a few seconds.

You can make it a subevent of a timer that’s either set at a fixed or random rate or maybe check the number of instances and trigger it when it falls below a certain number. Again fixed or random. The possibilities are infinite.