# How to get UE4 to ignore a infinite loop?

**URL:** <https://forums.unrealengine.com/t/how-to-get-ue4-to-ignore-a-infinite-loop/481993>\
**Category:** Platform & Builds\
**Tags:** infinite-loop, unreal-engine, question\
**Created:** [April 15, 2021, 10:55pm UTC](https://forums.unrealengine.com/t/how-to-get-ue4-to-ignore-a-infinite-loop/481993 "2021-04-15T22:55:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadowcalen1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@shadowcalen1](https://forums.unrealengine.com/u/shadowcalen1)\
**Post date:** [April 15, 2021, 10:55pm UTC](https://forums.unrealengine.com/t/how-to-get-ue4-to-ignore-a-infinite-loop/481993/1 "2021-04-15T22:55:49Z")

</div>

I have the following blueprint

 ![336037-capture2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/5/7/95771c28437da8364e02554b25f1e10ab7bfb6fd.png)

The goal of this blueprint is to damage the player when they enter the collision box, and to keep damaging them until they leave. However, this causes the game to crash because UE4 incorrectly detects that this is a infinite loop (if you leave the box the loop will stop).

Is there a way to have UE4 ignore this supposed error, or is there a better alternative for implementing a system like this?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 16, 2021, 6:51am UTC](https://forums.unrealengine.com/t/how-to-get-ue4-to-ignore-a-infinite-loop/481993/2 "2021-04-16T06:51:51Z")

</div>

Don’t use While - that’s not the intended use. Try it like this:

 ![336092-screenshot-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/f/e9fec2444ca59f281663fb890158b9cc4414560b.png)

It’s almost identical to this behaviour:

> **[How to get random spawner and only spawn if in range?](https://forums.unrealengine.com/questions/1024650/how-to-get-random-spawner-and-only-spawn-if-in-ran.html)**
>
> Hi, i’m new, and this is my first project. I have some spawners in the level (one in each corner for example), and i want to only when the player gets near the spawner, only that spawner spawn the enemie. I made this but it don’t work well ...

> ignore a infinite loop

The whole point of the Infinite Loop is to catch it / handle it, not ignore. If you ignore it, the game will crash.

---

<div class="post-metadata">

**Author:** ![shadowcalen1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@shadowcalen1](https://forums.unrealengine.com/u/shadowcalen1)\
**Post date:** [April 17, 2021, 10:47pm UTC](https://forums.unrealengine.com/t/how-to-get-ue4-to-ignore-a-infinite-loop/481993/3 "2021-04-17T22:47:09Z")

</div>

Well it does not crash anymore, but I had to set my timers initial start delay to be negative which is odd from a implementation standpoint. I appreciate your help.
