Hello, I know this might be quite vague as of course I don’t have my script attached to this post and thus not sharing exactly what UE is referencing here but here is the scenario: I have repetitively had this error message come up when playing through my game after 7-10 minutes and I’m not sure how to take this error message and use it to find what exactly is causing the problem. I understand there is an infinite loop being triggered within my EnemyAI but when following the hyperlinked buttons it points me to logic which seemingly cannot be looped like that.
the hyperlinks in that warning jump to the node the engine was executing when the runaway-loop detector tripped — in a real infinite loop that node is usually innocent, it is just where the budget expired. the loop itself completes elsewhere. patterns that produce this in AI blueprints:
- event ping-pong: A’s event calls into B, B calls back into A (interface messages between controller/pawn, a dispatcher bound to a handler that dispatches again). the callstack shows one leg of the cycle; the return leg is invisible in the links.
- MoveCompleted re-issue loops: on move completed you issue a new move command, the path fails instantly (goal unreachable, inside collision, zero-length path), MoveCompleted fires again immediately → tight loop with no frame in between. very common with AI and matches “after 7-10 minutes” if it triggers when something depletes or blocks.
- a loop whose exit condition depends on a value set outside the loop, or a DoOnce/Gate wired so the exit branch is never reached.
- recursion through a function where one branch silently never hits the exit condition.
how to actually find it:
- the warning dialog’s Debug button opens the callstack — look for the same event/function name appearing twice or more in the frame chain. the repeating pattern IS your cycle.
-
- instrument the suspects: Print String with the actor name + a counter at the entry of every event on EnemyAI that can fire autonomously (Tick, MoveCompleted, OnSeePawn / perception update, BT service ticks, any dispatcher handler). run your 7-10 minutes and see which print goes into non-stop firing right before the hang.
-
- watch for state flips: log the AI state (idle/chase/attack) at the top of the main events. a 7-10 minute delay before the loop smells like something runs out or expires and the fallback branch loops — e.g. no valid target → re-issue logic → re-issue logic.
fix is usually a guard: after issuing a move, do not re-issue until pathfollowing reports success or a real failure reason, and add a cooldown to any event that can re-trigger itself.
- watch for state flips: log the AI state (idle/chase/attack) at the top of the main events. a 7-10 minute delay before the loop smells like something runs out or expires and the fallback branch loops — e.g. no valid target → re-issue logic → re-issue logic.
