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

Method Fire

Source/Blaster/Weapon/Weapon.cpp:300–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300void AWeapon::Fire(const FVector& HitTarget)
301{
302 if (FireAnimation)
303 {
304 WeaponMesh->PlayAnimation(FireAnimation, false);
305 }
306 if (CasingClass)
307 {
308 const USkeletalMeshSocket* AmmoEjectSocket = WeaponMesh->GetSocketByName(FName("AmmoEject"));
309 if (AmmoEjectSocket)
310 {
311 FTransform SocketTransform = AmmoEjectSocket->GetSocketTransform(WeaponMesh);
312
313 UWorld* World = GetWorld();
314 if (World)
315 {
316 World->SpawnActor<ACasing>(
317 CasingClass,
318 SocketTransform.GetLocation(),
319 SocketTransform.GetRotation().Rotator()
320 );
321 }
322 }
323 }
324 SpendRound();
325}
326
327void AWeapon::Dropped()
328{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected