OnComponentBeginOverlap doesn't trigger


I dont know why but I can’t get OnComponentBeginOverlap to work.

On my Character I implemented it like this


	GetCapsuleComponent()->OnComponentBeginOverlap.AddDynamic(this, &ATOEUnit::OnUnitHit);

The Function

void ATOEUnit::OnUnitHit(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
	GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Hit!"));

I shoot a Projectile at a Character and it should trigger when overlaped.

Here are sscreenshots of the collision settings of the Character and of the projectile

I dont know why it isn’t firing

Did you add the UFUNCTION() macro before the declaration of the OnUnitHit function.