If you want to check for blocking hits, use this and put whatever you want to do inside. Make sure your mesh actually has a collision defined and that collision presets are set to block and GetStaticMeshComponent()->SetNotifyRigidBodyCollision(true) is in your constructor or BeginPlay:
virtual void NotifyHit (class UPrimitiveComponent * MyComp, AActor * Other, class UPrimitiveComponent * OtherComp, bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalImpulse, const FHitResult & Hit)
{
UE_LOG(LogTemp, Warning, TEXT("Hit something!");
}
for overlaps, define this function and make sure bGenerateOverlapEvents is set to true in constructor or BeginPlay:
void OnOverlapsBegin(UPrimitiveComponent *Comp, AActor *OtherActor, UPrimitiveComponent *OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
{
UE_LOG(LogTemp, Warning, TEXT("Overlapped something!");
}
Also, you have to bind that overlap delegate (the OnOverlapsBegin function I wrote above). So you would have to do this in BeginPlay or PostInitializeComponents:
virtual void PostInitializeComponents()
{
GetStaticMeshComponent()->OnComponentBeginOverlap.AddDynamic(this, &AMyStaticMeshActor::OnOverlapsBegin);
}
Finally, you can also use this function for overlaps which is much simpler if you're not comfortable with using delegates:
virtual void NotifyActorBeginOverlap(AActor *OtherActor)
{
UE_LOG(LogTemp, Warning, TEXT("Overlapped something!");
}