Infinite loop from destroy node

Hi,

I have a box component endOverlap event connected to a destroy actor with otherActor as target. I get a infinite loop error when the event fire, if i use a delay or doOnce node i don’t get the error. I don’t understand why, im guessing it’s a bug but im not sure. Hope someone can help.

Thx.

Hello Raikoh

I have also encountered this bug. I don’t exactly know what causes this to occur but there is a work around!

If you put a delay node between an event and DestroyActor it should stop the infinite loop.

This is how i got around it. Tell me if it works

Thanks

I guess because if you destroy an actor it again ends overlap with something else before it is gone. At least that is my assumption. Did you limit it to just overlap with a certain type. For instance you could do a cast or use an specific object channel to test it.

Yeah i aslo put a delay node of 0.001 when i get this bug.

Hello Raikoh.

Does the object in question need to be instantly destroyed upon ending the overlap?

If not you could do:

OnComponentEndOverlap->SetVisiblity(false)->Delay(0.2)->DestroyActor

Basically when the EndOverlap is called, it will make the object invisible and wait 0.2 seconds before destroying it, this should give the engine time to register the End Overlap.

If you need the object to stop any collision functionality such as OnComponentBeginOverlap you could try this as a work around:

OnComponentEndOverlap->SetVisiblity(false)->SetCollisionEnabled(false)->Delay(0.2)->DestroyActor

Tell me if this works.

Thanks

1 Like