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

Method BeginPlay

Source/Blaster/Weapon/Projectile.cpp:30–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void 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
52void AProjectile::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
53{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected