| 52 | } |
| 53 | |
| 54 | void AProjectileRocket::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit) |
| 55 | { |
| 56 | if (OtherActor == GetOwner()) |
| 57 | { |
| 58 | return; |
| 59 | } |
| 60 | ExplodeDamage(); |
| 61 | |
| 62 | StartDestroyTimer(); |
| 63 | |
| 64 | if (ImpactParticles) |
| 65 | { |
| 66 | UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ImpactParticles, GetActorTransform()); |
| 67 | } |
| 68 | if (ImpactSound) |
| 69 | { |
| 70 | UGameplayStatics::PlaySoundAtLocation(this, ImpactSound, GetActorLocation()); |
| 71 | } |
| 72 | if (ProjectileMesh) |
| 73 | { |
| 74 | ProjectileMesh->SetVisibility(false); |
| 75 | } |
| 76 | if (CollisionBox) |
| 77 | { |
| 78 | CollisionBox->SetCollisionEnabled(ECollisionEnabled::NoCollision); |
| 79 | } |
| 80 | if (TrailSystemComponent && TrailSystemComponent->GetSystemInstance()) |
| 81 | { |
| 82 | TrailSystemComponent->GetSystemInstance()->Deactivate(); |
| 83 | } |
| 84 | if (ProjectileLoopComponent && ProjectileLoopComponent->IsPlaying()) |
| 85 | { |
| 86 | ProjectileLoopComponent->Stop(); |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | void AProjectileRocket::Destroyed() |
| 91 | { |
nothing calls this directly
no outgoing calls
no test coverage detected