# Infinite loop begin play using beam

**URL:** <https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922>\
**Category:** World Creation\
**Tags:** beam, Trace, beginplay, infinite-loop, unreal-engine, question\
**Created:** [January 7, 2021, 6:41pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922 "2021-01-07T18:41:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soleniah](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Soleniah](https://forums.unrealengine.com/u/Soleniah)\
**Post date:** [January 7, 2021, 6:41pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922/1 "2021-01-07T18:41:34Z")

</div>

Hello there. I 've made a beam which can be blocked by a cube which I spawn. If i spawn the cube 620 units or less closer to the start point of the beam(screenshot3), the BP crashes and event begin play returns infinite loop.I have no idea what 's goin on. Any ideas?

alt text If the cube collides with the beam I set the beam and the collision from start point of beam to the cube.

 ![326583-error.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/2/c/a2cfd96c38c70d36a9a0443ac758923a53872861.png)

---

<div class="post-metadata">

**Author:** ![Soleniah](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Soleniah](https://forums.unrealengine.com/u/Soleniah)\
**Post date:** [January 7, 2021, 6:42pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922/2 "2021-01-07T18:42:16Z")

</div>

![326586-end-overlap.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/5/1f5d205655a07eed6efd87b20a436a36c034957b.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [January 7, 2021, 7:37pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922/3 "2021-01-07T19:37:53Z")

</div>

Try putting a DoOnce on the overlap events.

---

<div class="post-metadata">

**Author:** ![Soleniah](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Soleniah](https://forums.unrealengine.com/u/Soleniah)\
**Post date:** [January 7, 2021, 9:24pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922/4 "2021-01-07T21:24:50Z")

</div>

i need the overlap events to keep overlapping in my game not just once 😕

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [January 7, 2021, 9:46pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922/5 "2021-01-07T21:46:16Z")

</div>

Yes, but try a do once to make sure they’re not firing many times on spawn ( it’s a long shot ). If that’s the case, you can then mod the code to cope…

---

<div class="post-metadata">

**Author:** ![Big\_Squirmy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Big\_Squirmy](https://forums.unrealengine.com/u/Big_Squirmy)\
**Post date:** [January 7, 2021, 10:00pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922/6 "2021-01-07T22:00:16Z")

</div>

I would make an extra event and call it. Sometimes having stuff like this in begin play does weird stuff. Also could try a short delay before the logic.

---

<div class="post-metadata">

**Author:** ![Soleniah](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Soleniah](https://forums.unrealengine.com/u/Soleniah)\
**Post date:** [January 8, 2021, 12:31pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922/7 "2021-01-08T12:31:38Z")

</div>

Beginoverlap : If I spawn the actor close to the start point of the beam, it fires twice

beginoverlap +do once: working fine

begin overlap + end overlap : if i spawn the actor close to the start point it forces and run endoverlap by itself

No idea what 's going on  
The actors collision is fine. I disabled the mesh collision and set collision only for box.

---

<div class="post-metadata">

**Author:** ![Soleniah](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Soleniah](https://forums.unrealengine.com/u/Soleniah)\
**Post date:** [January 8, 2021, 12:33pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922/8 "2021-01-08T12:33:10Z")

</div>

I mean it 's strange because it only happens like 700 units closer to the start point of beam. If the actor is far it 's all good

---

<div class="post-metadata">

**Author:** ![Soleniah](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Soleniah](https://forums.unrealengine.com/u/Soleniah)\
**Post date:** [January 8, 2021, 12:40pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922/9 "2021-01-08T12:40:08Z")

</div>

![326627-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/e/d9e257dfb4467a653d465587c163e6435e510731.png)

 ![326629-3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/7/42721383cb3251e0e40c40d6f9e64fda0833dcd3.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [January 8, 2021, 1:31pm UTC](https://forums.unrealengine.com/t/infinite-loop-begin-play-using-beam/476922/10 "2021-01-08T13:31:22Z")

</div>

Overlap is not a neat thing. I you want get control of it, use DoOnce, and reset it at a sensible time ( here, that would be on endoverlap ).
