So, I have a bullet projectile. Here’s the relevant part of the header file:
UFUNCTION()
void OnBulletHit(AActor* SelfActor, AActor* OtherActor, FVector NormalImpulse, const FHitResult& Hit);
And here’s the part of the cpp file. In the instructor:
BulletMesh = CreateDefaultSubobject<UStaticMeshComponent>("BulletMesh");
BulletMesh->SetNotifyRigidBodyCollision(true);
BulletMesh->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
and the function (outside of the instructor):
void AProjectile::OnBulletHit(AActor* SelfActor, AActor* OtherActor, FVector NormalImpulse, const FHitResult& Hit)
{
UE_LOG(LogTemp, Warning, TEXT("HIT!!"))
Destroy();
}
What could be the reason for the function to never get called?
Thanks!