I have been following the GameDev.tv’s Unreal Engine 5 tutorial and I came across the delegate
StaticMeshComponent->OnComponentHit.AddDynamic(this, &AProjectile::OnHit);
with the OnHit functions declared as
void AProjectile::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& HitResult)
{
UE_LOG(LogTemp, Warning, TEXT("%s, %s, %s"), *HitComp->GetName(), *OtherActor->GetName(), *OtherComp->GetName());
}
I wanted to know from where the parameter list in the OnHit came from as the OnHitComponent takes the parameters specific to it. I also went through the Unreal C++ docs, but couldn’t find anything relevant to it.