# Spawning a new actor of the same class infinite loop Solved! But i have another problem with collision of pawn

**URL:** <https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173>\
**Category:** World Creation\
**Tags:** spawn, spawn-actor-from-cla, infinite-loop, unreal-engine, Blueprint, question\
**Created:** [January 16, 2015, 7:50pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173 "2015-01-16T19:50:34Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![KristofferF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KristofferF](https://forums.unrealengine.com/u/KristofferF)\
**Post date:** [January 16, 2015, 7:50pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/1 "2015-01-16T19:50:34Z")

</div>

![26938-error+ue4.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/8/3389932cba0f40617fb30a130ba1b2b6c11ff828.jpeg)

I’m trying to create a form of endless runner test from the roller project. I have some problem with “Infinite Loop detected in blueprint: Cube”

You can see in the picture that I’m trying to spawn a new cubes section whenever you roll under one cube section. There is a box trigger in the passageway. It works when I’m only spawning the explosion but the spawn actor event get this error.

Thankful for any answers.

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [January 16, 2015, 7:59pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/2 "2015-01-16T19:59:50Z")

</div>

Hi KristofferF,

Which version of the editor are you using?

---

<div class="post-metadata">

**Author:** ![KristofferF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KristofferF](https://forums.unrealengine.com/u/KristofferF)\
**Post date:** [January 16, 2015, 8:02pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/3 "2015-01-16T20:02:56Z")

</div>

Hi I tried 4.5.1 and 4.6.1

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [January 16, 2015, 8:15pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/4 "2015-01-16T20:15:41Z")

</div>

Okay, I see what you are doing now. Getting an infinite loop in this situation is correct, you can’t spawn a blueprint with itself. You will need to create a separate blueprint (or use the level blueprint) to spawn other instances of the Cube blueprint.

Cheers,

TJ

---

<div class="post-metadata">

**Author:** ![KristofferF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KristofferF](https://forums.unrealengine.com/u/KristofferF)\
**Post date:** [January 16, 2015, 10:17pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/5 "2015-01-16T22:17:35Z")

</div>

Ok thanks i will try that. Why does it become a loop? A new cube that is being spawned shouldn’t set of its own box trigger right?

---

<div class="post-metadata">

**Author:** ![KristofferF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KristofferF](https://forums.unrealengine.com/u/KristofferF)\
**Post date:** [January 18, 2015, 1:49pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/6 "2015-01-18T13:49:48Z")

</div>

It works now. My floor spawns a trigger volume that spawns a new floor when triggered and so on.

Now I have another problem. Why doesn’t my ball which is a pawn get noticed by the trigger volume. I use custom collisions but I have to use physics body as overlap. Pawn doesn’t work. It doesn’t get triggered.

Why?

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [January 19, 2015, 4:14pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/7 "2015-01-19T16:14:17Z")

</div>

By default, the setting for the PhysicsBallBP collision is PhysicsActor. You will need to make sure that the Collision Preset of the PhysicsBallBP and the blueprint Trigger volume will interact.

Try one of these settings:

PhysicsBallBP = PhysicsActor & Trigger = OverlapAllDynamic

or

PhysicsBallBP = Pawn & Trigger = OverlapOnlyPawn

---

<div class="post-metadata">

**Author:** ![KristofferF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KristofferF](https://forums.unrealengine.com/u/KristofferF)\
**Post date:** [January 24, 2015, 3:40pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/8 "2015-01-24T15:40:20Z")

</div>

Hi I don’t understand how you mean i should implement this. Is it C++ code?  
Just doing Blueprint now. Or where in blueprint do i set these settings?

I solved it by doing Cast to PhysicasBallBP from OnComponentBeginOverlap like this pictures show! But I still what to know how you meant I should solve it?

---

<div class="post-metadata">

**Author:** ![TJ\_V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tj_v/32/1008648_2.png) [@TJ\_V](https://forums.unrealengine.com/u/TJ_V)\
**Post date:** [January 26, 2015, 2:36pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/9 "2015-01-26T14:36:11Z")

</div>

Sorry about that. It’s the settings contained inside of the PhysicsBallBP character and Cube blueprint components.

- Inside of the PhysicsBallBP set the '[ROOT]Ball component Collision Preset to ‘PhysicsActor’.

- Inside of the Cube blueprint, set the Trigger components Collision Preset to ‘OverlapAllDynamic’

or

- Inside of the PhysicsBallBP set the '[ROOT]Ball component Collision Preset to ‘Pawn’.

- Inside of the Cube blueprint, set the Trigger components Collision Preset to ‘OverlapOnlyPawn’

 ![27946-collisionsettings01.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/a/a8a2d2f251067b5e7e8e2cff2fe117a2a56d91c1.jpeg)

 ![27947-collisionsettings02.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/9/9b92947659f1ca43ea532106aeb50254548b1119.jpeg)

---

<div class="post-metadata">

**Author:** ![KristofferF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KristofferF](https://forums.unrealengine.com/u/KristofferF)\
**Post date:** [January 28, 2015, 5:58pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/10 "2015-01-28T17:58:30Z")

</div>

Ok perfect. Thanks for the help.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e5ae640c1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e5ae640c1](https://forums.unrealengine.com/u/anonymous_user_e5ae640c1)\
**Post date:** [July 17, 2015, 7:02pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/11 "2015-07-17T19:02:48Z")

</div>

I use OverlapOnlyPawn under collision presets for my box collider. I hope this helps. Cheers

---

<div class="post-metadata">

**Author:** ![edwbru8066](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/edwbru8066/32/961536_2.png) [@edwbru8066](https://forums.unrealengine.com/u/edwbru8066)\
**Post date:** [July 29, 2023, 4:39pm UTC](https://forums.unrealengine.com/t/spawning-a-new-actor-of-the-same-class-infinite-loop-solved-but-i-have-another-problem-with-collision-of-pawn/304173/12 "2023-07-29T16:39:37Z")

</div>

Thanks! This fixed it for me!!! I never would have figured this out!!!
