Only Single Component Hit

.h file

UFUNCTION() void WhenHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);

.cpp file

void AMyPlayerChar::BeginPlay() { Super::BeginPlay();
              GetCapsuleComponent()->OnComponentHit.AddDynamic(this, &AMyPlayerChar::WhenHit);
}

void AMyPlayerChar::WhenHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit) {
              if (OtherComp->ComponentHasTag("WallHit")) 
    UE_LOG(LogTemp, Display, TEXT("Other->ComponentHasTag WallHit"));
}

I need Multiple Components To Hit, the capsule when hit example floor then other component hit like boxCollision at one time multiple hit not work, otherwise character jump not collision with floor then hit “WallHit” tag component then work but multiple component hit each then not work only detect one component which current collider

  • I also try BlockAll, BlockAllDynamics, Simulated_Physics, Simulated_Collision*