C++ OnComponentEndOverlap Not Working

Begin overlap is working fine, but I can’t get end overlap to trigger.

.h file:

UPROPERTY(VisibleAnywhere, Category = "Default")
UBoxComponent* BoxCollision = nullptr;

UFUNCTION()
void OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult);
	
UFUNCTION()
void OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);

.cpp file - constructor

   BoxCollision->bGenerateOverlapEvents = true;
	BoxCollision->OnComponentBeginOverlap.AddDynamic(this, &ADisplacementTankSlot::OnOverlapBegin);
	BoxCollision->OnComponentEndOverlap.AddDynamic(this, &ADisplacementTankSlot::OnOverlapEnd);

.cpp functions

void ADisplacementTankSlot::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
{
	UE_LOG(LogTemp, Warning, TEXT("OVERLAP BEGIN"));
}

void ADisplacementTankSlot::OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{
	UE_LOG(LogTemp, Warning, TEXT("OVERLAP END"));
}

So this post here suggests that it doesn’t work because it’s a bug with the engine: https://answers.unrealengine.com/questions/419154/component-end-overlap-not-working-c.html

I tried using OnActorEndOverlap instead, and that indeed does work. So is this still a bug with the engine? How has this not been fixed?

That bug UE-29879 is marked as Cannot Reproduce and is closed.

If you have a project / steps to reproduce the issue, I encourage you to post in the Bug Reports section with as much detail as possible. How to write a bug.

It’s amazing. But it still doesn’t work. I use UE 5.2.1.