Hi,
I’m following along in the ToonTanks section and I’ve got the ProjectileBase all set up like the instructor, as far as I can tell:
ProjectileBase.h:
UFUNCTION()
void OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpuse, const FHitResult& Hit);
ProjectileBase.cpp:
void AProjectileBase::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpuse, const FHitResult& Hit)
{
AActor* MyOwner = GetOwner();
if (!MyOwner)
{
return;
}
if(OtherActor && OtherActor != this && OtherActor != MyOwner)
{
UGameplayStatics::ApplyDamage(OtherActor, Damage, MyOwner->GetInstigatorController(), this, DamageType);
}
Destroy();
}
But for some reason I can’t get the OnHit() to fire. I even tried putting a UE_LOG right at the beginning of OnHit() to see if it was being interrupted somewhere in the middle, but the log never even fired.
Am I missing something here?