Fix minor bugs
This commit is contained in:
parent
95a7b28db2
commit
baf54dd6f5
|
@ -142,7 +142,9 @@ void AEnemyCharacter::OnDamaged()
|
||||||
{
|
{
|
||||||
Super::OnDamaged();
|
Super::OnDamaged();
|
||||||
|
|
||||||
AEnemyAIController* controller = Cast<AEnemyAIController>(GetController());
|
if (AEnemyAIController* controller = Cast<AEnemyAIController>(GetController()))
|
||||||
controller->GetBlackboardComponent()->SetValueAsFloat("CurrentHealth", GetHealthComponent()->GetCurrentHealth());
|
{
|
||||||
|
controller->GetBlackboardComponent()->SetValueAsFloat("CurrentHealth", GetHealthComponent()->GetCurrentHealth());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -275,12 +275,15 @@ void ANakatomiCharacter::PlayOnFireAnimations()
|
||||||
|
|
||||||
void ANakatomiCharacter::OnDamaged()
|
void ANakatomiCharacter::OnDamaged()
|
||||||
{
|
{
|
||||||
int32 randomAnimMontage = FMath::RandRange(0,OnDamagedHitAnimMontages.Num()-1);
|
if (OnDamagedHitAnimMontages.Num() > 0)
|
||||||
|
|
||||||
if (OnDamagedHitAnimMontages[randomAnimMontage] != nullptr)
|
|
||||||
{
|
{
|
||||||
//TODO: Disable movement while playing animation montage
|
int32 randomAnimMontage = FMath::RandRange(0,OnDamagedHitAnimMontages.Num()-1);
|
||||||
// PlayAnimMontage(OnDamagedHitAnimMontages[randomAnimMontage]);
|
|
||||||
|
if (OnDamagedHitAnimMontages[randomAnimMontage] != nullptr)
|
||||||
|
{
|
||||||
|
//TODO: Disable movement while playing animation montage
|
||||||
|
// PlayAnimMontage(OnDamagedHitAnimMontages[randomAnimMontage]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue