Hey all, it’s the noob of the month here again trying to fix my logic and asking for help ![]()
Let me explain my conundrum first…
So the game I’m trying to put together has a few features pertinent to this scenario:
- The player gets a specific # of ammo on each level (this changes from lvl to lvl) info is stored in a data table and is updated in the GM every time a new level loads.
- The level contains exactly the same amount of targets as the player’s ammo for that specific lvl (data from table)
Bound to LeftClick in the PlayerController BP I have the following logic:
Let me explain my logic here and please by all means correct me since it’s not working properly: ![]()
On left click, first I check to see if the user still has bullets.
HasAmmo(1) → If Yes, → Spawn new bullet → Update Ammo (in GM), check again if user HasAmmo(2) after the spawn. If Yes → check targets left in the level (function in GM). If targets == 0 → EndLevel
HasAmmo(2) after the spawn. If No (means that was the last bullet → Delay (1sec, in case that last bullet hits the last target) → EndLevel
HasAmmo(1) → If No, → EndLevel
To make matters a bit crazier… in GM I have a tick that also checks to see if there are targets left:
Event Tick (GM):
CheckTargets func:
EndLevel Funct:
Now… if that wasn’t enough, I also have a custom event timer that when 1 min runs out calls → EndLevel yet again.
LevelTimer:
CountdownTimer func:
My issue is that when the last bullet is shot, if it hits the last target, CheckTargets calls → EndLevel…
However, immediately after that (1sec Delay) HasAmmo(2) No branch gets executed and EndLevel gets called again.
And 1.5 sec later HasAmo(1) No branch, calls EndLevel again ![]()
I thought by Pausing the game in EndLevel, the other execution nodes would not fire, but I guess the Delay still fires after Set Game Paused “True”???
Any tips on handling this scenario is greatly appreciated.
I know it might be an easy fix, but can’t figure it out fml.











