Hey peeps! I’ve created a black hole in my level…but the overlapping components are not getting destroyed.
void AFPSBlackHole::BeginPlay()
{
Super::BeginPlay();
InnerSphereComp->OnComponentBeginOverlap.AddDynamic(this, &AFPSBlackHole::OverlapInnerSphere);
}
void AFPSBlackHole::OverlapInnerSphere(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
if (OtherActor)
{
OtherActor->Destroy();
}
}