Why doesn't multiple events get called on ActorBeginOverlap?

I’m making a beginner game where I spawn enemies, health packs, ammo packs randomly in an actor which is a box. This BP typically works when I use it in Level BP with BeginPlay, but now since I want to restrict it to certain areas of a level after the player enters I took this approach.

For some reason only the first event gets called, regardless of the order of events… How would I make it call all the events?

In your fSpawnEnemy, fSpawnHealthPack and fSpawnAmmoPack functions add a PrintString node that prints function name and see if it prints it - it should print the first function after 2 seconds, second one after 5 seconds and the last one after 10 seconds.
Timers don’t execute functions immediately, the functions will be called after X specified time. If you want to fire the functions immediately after overlap and start the timer, try something like this, I’ve recreated your setup and it works properly:


Hello, thank you for helping.

So I tried with just Print String and it works, but when I do spawns it doesn’t.
When I connect the Spawning after Print String and do it like how you did ‘ahhelp.png’, I end up getting an infinite loop on Spawn Enemy…

If I take out those Function calls before the ‘Set Timer by Function Name’, the program runs but it only spawns enemies every 2 seconds…

Not sure why this happens, cause this spawn code normally works in Level BP with BeginPlay. And it’s why I assumed it was an issue with overlap.

Good, so we’ve narrowed down the issue.

If it results with infinite loop, then maybe something like this happens:

  1. On Event ActorBeginOverlap, it spawns a minion
  2. Minion triggers the Event ActorBeginOverlap
  3. The event spawns another minion. Back to point 1, and we have an infinite loop.

Do you want your minions to trigger this overlap event? If not, you can try casting the “Other Actor” output from the event to your minion class and progress only if cast fails. Just as a quick test, since I’m not sure how the rest of your logic is set.

Without these extra events, I suspect that something like that might happen:
Every time a minion triggers the event, it restarts all the timers this way. That’s why only the first one fires, the next timers are reset (counting from beginning) every time the first function is executed (when it spawns a minion).

Oh! Makes perfect sense… Now that I think about that fact I’m stupid…
Yeah the reason it always worked in Level BP before was I didn’t activate it through an overlap, so never had the issue of Minions spawning and redoing the loop resulting in Health/Ammo being ignored.

Yeah that was definitely the issue, it’s only supposed to trigger once when the Player overlaps the area to start a survival-ish type of mode. Thank you for your help.