how to create actor every given seconds?

manaskk

  • Posts: 153
hi guys, i am trying to spawn actors every given seconds, which is subject to change as the game goes on. I have used this method (see the attachment) to generate actors in when created event. If i want to updates the seconds with a variable i can only do that in when updating right? but it is suggested not to use "do every seconds" in when updating event. then how can i get this workable? I have tried the same code in updating but the game has serious lags. any advice please?

JeffreyDriver

  • Posts: 2262
If you put a 'do every' event, the number is fixed at it's initial value. Let's say it starts at 7, it will remain at 7 event if you try and change it. Putting it in an always event doesn't work as it runs 100 times per second, so you start spawning hundreds of actors.

Use a custom event with a number attribute that you can change as you like. Trigger it once, then you place a trigger inside the custom event. You could also put a boolean inside to turn it on and off.

manaskk

  • Posts: 153
Thanks a lot jeffery! I am gonna work it out this way.