Updated Combat to Set Camera to Face Enemy
This commit is contained in:
parent
b5048e4be3
commit
d100a85a0d
BIN
Content/Assets/Objects/Tutrorial_Assets/Tutorial_Wood_Texture.uasset
(Stored with Git LFS)
BIN
Content/Assets/Objects/Tutrorial_Assets/Tutorial_Wood_Texture.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Levels/Build.umap
(Stored with Git LFS)
BIN
Content/Levels/Build.umap
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Levels/C2Plane.uasset
(Stored with Git LFS)
BIN
Content/Levels/C2Plane.uasset
(Stored with Git LFS)
Binary file not shown.
@ -122,7 +122,7 @@ void ATempCharacter::KeyPressed()
|
||||
// Line trace logic
|
||||
void ATempCharacter::LineTraceLogic()
|
||||
{
|
||||
UE_LOG(LogTemp, Display, TEXT("LineTraceLogic activated"));
|
||||
//UE_LOG(LogTemp, Display, TEXT("LineTraceLogic activated"));
|
||||
float GlobalTrace = TraceDistance;
|
||||
FHitResult OutHit;
|
||||
ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>());
|
||||
|
@ -28,7 +28,6 @@ protected:
|
||||
UFUNCTION()
|
||||
void Sneak();
|
||||
|
||||
|
||||
UCapsuleComponent* PlayerCapsule;
|
||||
|
||||
public:
|
||||
@ -90,7 +89,7 @@ public:
|
||||
|
||||
APostProcessVolume* PostProcessVolume;
|
||||
|
||||
TArray <AActor*> AIActors;
|
||||
TArray<AActor*> AIActors;
|
||||
|
||||
FName Enemy;
|
||||
|
||||
|
@ -36,7 +36,6 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy)
|
||||
EnemyBlackboard->SetValueAsBool("IsInCombat", true);
|
||||
FProperty* HealthProperty = Enemy->GetClass()->FindPropertyByName(FName("Health"));
|
||||
int32* EnemyHealthPtr = HealthProperty->ContainerPtrToValuePtr<int32>(Enemy);
|
||||
|
||||
EnemyHealth = EnemyHealthPtr;
|
||||
|
||||
if (HUD->IsInViewport()) return;
|
||||
@ -58,6 +57,14 @@ void ATurnBaseCombatV2::StartCombat(AActor* Enemy)
|
||||
PlayerController->SetInputMode(FInputModeUIOnly());
|
||||
PlayerController->bShowMouseCursor = true;
|
||||
|
||||
FVector Direction = Enemy->GetActorLocation() - PlayerActor->GetActorLocation();
|
||||
Direction.Normalize();
|
||||
FRotator LookAtRotation = FRotationMatrix::MakeFromX(Direction).Rotator();
|
||||
LookAtRotation.Pitch = -9.0f;
|
||||
PlayerController->SetControlRotation(LookAtRotation);
|
||||
|
||||
//DrawDebugPoint(GetWorld(), Enemy->GetActorLocation(), 10, FColor::Red, false, 10);
|
||||
|
||||
CurrentComboString = "";
|
||||
UpdateComboString(CurrentComboString);
|
||||
RevertActionPoints();
|
||||
|
Loading…
Reference in New Issue
Block a user