.h
UFUNCTION()
void OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
USphereComponent * SphereComp;
.cpp
SphereComp = CreateDefaultSubobject <USphereComponent>(TEXT("SphereComp"));
SphereComp->SetCollisionProfileName(TEXT("Collision"));
SphereComp->SetupAttachment(RootComponent);
SphereComp->OnComponentBeginOverlap.AddDynamic(this, &AArrow::OnOverlapBegin);
}
void AArrow::OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
if (GEngine)
{
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("Overlap"));
}
}
Idk why but its not Overlapping.