Update Enemy Character for Damage Implementation
This commit is contained in:
parent
29b436434b
commit
e03c19e421
BIN
EndlessVendetta/Content/AI/Enemy/Basic/BP_BasicEnemyCharacter.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/AI/Enemy/Basic/BP_BasicEnemyCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -91,7 +91,7 @@ void ABaseWeaponClass::ApplyRecoil(float DeltaTime)
|
|||||||
traceEnd = traceStart + (UKismetMathLibrary::GetForwardVector(playerInWorld->GetControlRotation() * GetRecoilPitch(amplitude, recoilTime)));
|
traceEnd = traceStart + (UKismetMathLibrary::GetForwardVector(playerInWorld->GetControlRotation() * GetRecoilPitch(amplitude, recoilTime)));
|
||||||
//UE_LOG(LogTemp, Warning, TEXT("Controller pitch: Pitch: %f Yaw: %f, Roll: %f"), playerInWorld->GetControlRotation().Pitch, playerInWorld->GetControlRotation().Yaw, playerInWorld->GetControlRotation().Roll);
|
//UE_LOG(LogTemp, Warning, TEXT("Controller pitch: Pitch: %f Yaw: %f, Roll: %f"), playerInWorld->GetControlRotation().Pitch, playerInWorld->GetControlRotation().Yaw, playerInWorld->GetControlRotation().Roll);
|
||||||
playerInWorld->AddControllerYawInput(GetRecoilYaw(amplitude, recoilTime));
|
playerInWorld->AddControllerYawInput(GetRecoilYaw(amplitude, recoilTime));
|
||||||
UE_LOG(LogTemp, Warning, TEXT("recoilTime: %f"), recoilTime);
|
//UE_LOG(LogTemp, Warning, TEXT("recoilTime: %f"), recoilTime);
|
||||||
UpdateSamples(amplitude, recoilTime);
|
UpdateSamples(amplitude, recoilTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,6 +169,8 @@ void ABaseWeaponClass::Fire()
|
|||||||
bulletCountShoot += 1;
|
bulletCountShoot += 1;
|
||||||
if (outHit.bBlockingHit)
|
if (outHit.bBlockingHit)
|
||||||
{
|
{
|
||||||
|
UE_LOG(LogTemp, Display, TEXT("Ammo Count: %s"), *outHit.GetActor()->GetName());
|
||||||
|
if (!Cast<AAICharacter>(outHit.GetActor())) return;
|
||||||
Cast<AAICharacter>(outHit.GetActor())->TakeDamage(WeaponDamage, FPointDamageEvent(), GetWorld()->GetFirstPlayerController(), this);
|
Cast<AAICharacter>(outHit.GetActor())->TakeDamage(WeaponDamage, FPointDamageEvent(), GetWorld()->GetFirstPlayerController(), this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user