Bugfix Movement Enabled During Combat in TBCv2

This commit is contained in:
Philip W 2022-11-21 22:34:33 +00:00
parent 6a041e4621
commit 22c13a8c25
7 changed files with 22 additions and 15 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -38,6 +38,9 @@ void ATurnBaseCombatV2::EndCombat()
{
//Remove the HUD from the viewport
HUD->RemoveFromViewport();
APawn* PlayerPawn = Cast<APawn>(GetWorld()->GetFirstPlayerController()->GetPawn());
PlayerPawn->bUseControllerRotationYaw = true;
PlayerPawn->bUseControllerRotationPitch = true;
}
void ATurnBaseCombatV2::BeginPlay()
@ -45,7 +48,12 @@ void ATurnBaseCombatV2::BeginPlay()
Super::BeginPlay();
TArray<AActor*> AllCharacterActorsInScene;
UGameplayStatics::GetAllActorsOfClassWithTag(GetWorld(), AActor::StaticClass(), FName("Character"), AllCharacterActorsInScene);
UGameplayStatics::GetAllActorsOfClassWithTag(GetWorld(), AActor::StaticClass(), FName("Player"), AllCharacterActorsInScene);
for (AActor* Actor : AllCharacterActorsInScene)
{
PlayerActor = Cast<AActor>(Actor);
}
HUD = CreateWidget<UUserWidget>(GetWorld(), HUDWidget);

View File

@ -30,11 +30,13 @@ public:
UPROPERTY(EditDefaultsOnly)
int SulfurResource = 10; // W
// AActor* PlayerActor;
UPROPERTY(VisibleAnywhere)
AActor* PlayerActor;
UPROPERTY(VisibleAnywhere)
AActor* EnemyActor;
// AActor* ActiveActor;
UPROPERTY(BlueprintReadWrite)
UUserWidget* HUD;
/*
TODO:
Reference Player Inventory
@ -71,9 +73,6 @@ protected:
private:
bool IsValidCombo(FString Combo) const;
UPROPERTY()
UUserWidget* HUD;
UPROPERTY(VisibleAnywhere)
bool bIsPlayerTurn = true;