| 28 | } |
| 29 | |
| 30 | void AProjectile::BeginPlay() |
| 31 | { |
| 32 | Super::BeginPlay(); |
| 33 | |
| 34 | if (Tracer) |
| 35 | { |
| 36 | TracerComponent = UGameplayStatics::SpawnEmitterAttached( |
| 37 | Tracer, |
| 38 | CollisionBox, |
| 39 | FName(), |
| 40 | GetActorLocation(), |
| 41 | GetActorRotation(), |
| 42 | EAttachLocation::KeepWorldPosition |
| 43 | ); |
| 44 | } |
| 45 | |
| 46 | if (HasAuthority()) |
| 47 | { |
| 48 | CollisionBox->OnComponentHit.AddDynamic(this, &AProjectile::OnHit); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | void AProjectile::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit) |
| 53 | { |
nothing calls this directly
no outgoing calls
no test coverage detected