OnComponentBeginOverlap and OnComponentEndOverlap infinite loop

Hi,

I’m making a 2d platforming game with Paper2D. I needed the platforms of my level to block my character only when it was on top. I looked around in answers and found: How do i make a one way collision with a character? - World Creation - Unreal Engine Forums

I tried more or less the same solution. I made a blueprint for my platforms. That blueprint has a sprite, a bounding box for collision and another box under it to calculate when platform needs to ignore the main character and when it has to block it. I used the following blueprint:

Platform Floor has it’s own object type called “Platform” which blocks everything. The idea was that, whenever the player overlaps the trigger box under the platform, the platform box is set to ignore. Whenever the overlaping with the trigger box ends, it changes platform box back to block.

The problem is when I run the game, this produces an inifinite loop and I don’t know why. ¿Can someone explain?

I can explain:

void UPrimitiveComponent::SetCollisionResponseToChannel(ECollisionChannel Channel, ECollisionResponse NewResponse)
{
	BodyInstance.SetResponseToChannel(Channel, NewResponse);
	OnComponentCollisionSettingsChanged();
}

Then:

void UPrimitiveComponent::OnComponentCollisionSettingsChanged()
{
if (!IsTemplate() && IsRegistered()) // not for CDOs
{
// changing collision settings could affect touching status, need to update
UpdateOverlaps();
}
}

UpdateOverlaps(); checks overlaps for each call of SetCollisionResponseToChannel. I think it may fire OnCompBegin overlap when overlap has been ended but I don’t this for sure.

This makes a lot of sense about what’s happening!