MCPcopy Create free account
hub / github.com/DruidMech/MultiplayerCourseBlasterGame / OnHit

Method OnHit

Source/Blaster/Weapon/ProjectileRocket.cpp:54–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void 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
90void AProjectileRocket::Destroyed()
91{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected