diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index c6816ca..b3c682e 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -249,8 +249,7 @@ void ATurnBaseCombatV2::Tick(const float DeltaTime) { APlayerController* PlayerController = GetWorld()->GetFirstPlayerController(); FProperty* IsBossProperty = FindFieldChecked(EnemyActor->GetClass(), "IsBoss"); - const FBoolProperty* IsBossBoolProperty = CastFieldChecked(IsBossProperty); - if (IsBossBoolProperty->GetPropertyValue_InContainer(EnemyActor)) + if (const FBoolProperty* IsBossBoolProperty = CastFieldChecked(IsBossProperty); IsBossBoolProperty->GetPropertyValue_InContainer(EnemyActor)) { FOutputDeviceNull AR; const FString Command = FString::Printf(TEXT("TriggerCombatAnimation true")); @@ -270,7 +269,7 @@ void ATurnBaseCombatV2::Tick(const float DeltaTime) FRotator LookAtRotation = FRotationMatrix::MakeFromX(Direction).Rotator(); const FRotator NewRotation = UKismetMathLibrary::FindLookAtRotation(Cast(PlayerActor->FindComponentByClass())->GetComponentLocation(), Cast(EnemyActor->FindComponentByClass())->GetComponentLocation()); LookAtRotation.Pitch = NewRotation.Pitch - PlayerActor->GetActorRotation().Pitch; - Cast(PlayerActor->FindComponentByClass())->SetWorldRotation(LookAtRotation); + PlayerController->SetControlRotation(LookAtRotation); } } }