Bugfix Character Unable to Climb Stairs Consistently

This commit is contained in:
Philip W 2023-05-20 00:43:05 +01:00
parent bc98daea6f
commit 8108050bd6
9 changed files with 22 additions and 17 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -142,6 +142,7 @@ void UDialogueNPC::TickComponent(float DeltaTime, ELevelTick TickType, FActorCom
void UDialogueNPC::StartDialogue()
{
Cast<ATempCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->bIsInDialogue = true;
bIsInDialogue = true;
Quests.Empty();
BlueprintFunctions.Empty();
@ -179,6 +180,7 @@ void UDialogueNPC::StartDialogue()
void UDialogueNPC::EndDialogue()
{
Cast<ATempCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->bIsInDialogue = false;
bIsInDialogue = false;
TextAnimationTimerHandle.Invalidate();
DialogueWidgetInstance->RemoveFromParent();

View File

@ -21,6 +21,9 @@ public:
ATempCharacter();
void ResetWidgetPointer() const;
UPROPERTY(BlueprintReadOnly)
bool bIsInDialogue = false;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
@ -45,8 +48,8 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Inventory, meta = (AllowPrivateAccess = "true"))
class UInventoryComponent* Inventory; //Using the InventoryComponent class
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
@ -111,7 +114,7 @@ public:
UPROPERTY()
UUserWidget* ImportantStatsWidget;
UPROPERTY()
UUserWidget* CrossHairWidget;
@ -123,7 +126,7 @@ public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Widgets")
UUserWidget* EscapeMenuWidget;
UPROPERTY(EditAnywhere, Category= "Widgets")
TSubclassOf<UUserWidget> ImportantStatsSub;
@ -137,7 +140,6 @@ public:
TSubclassOf<UUserWidget> CrossHairSub;
private:
UPROPERTY()
FHitResult OutHit;

View File

@ -9,6 +9,7 @@
#include "Blueprint/UserWidget.h"
#include "Camera/CameraComponent.h"
#include "Misc/OutputDeviceNull.h"
#include "the_twilight_abyss/PlayerTemp/TempCharacter.h"
// Sets default values for this component's properties
@ -72,7 +73,7 @@ void UHoldToInitCombat::OnClickDown()
const AActor* PlayerActor = GetWorld()->GetFirstPlayerController()->GetPawn();
const UStaticMeshComponent* GunComponent = Cast<UStaticMeshComponent>(PlayerActor->GetComponentsByTag(UPrimitiveComponent::StaticClass(), FName("Gun"))[0]);
const FVector GunLocationOffset = GunComponent->GetSocketTransform("Muzzle").GetLocation();
UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), GunEffect, GunLocationOffset, PlayerActor->GetActorRotation());
UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), GunEffect, GunLocationOffset, Cast<ATempCharacter>(PlayerActor)->Controller->GetControlRotation());
FOutputDeviceNull AR;
const FString Command = FString::Printf(TEXT("PlayCameraShakeShoot"));
this->GetOwner()->CallFunctionByNameWithArguments(*Command, AR, nullptr, true);

View File

@ -359,7 +359,7 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo)
{
const UStaticMeshComponent* GunComponent = Cast<UStaticMeshComponent>(PlayerActor->GetComponentsByTag(UPrimitiveComponent::StaticClass(), FName("Gun"))[0]);
const FVector GunLocationOffset = GunComponent->GetSocketTransform("Muzzle").GetLocation();
UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), GunEffect, GunLocationOffset, PlayerActor->GetActorRotation());
UNiagaraFunctionLibrary::SpawnSystemAtLocation(GetWorld(), GunEffect, GunLocationOffset, Cast<ATempCharacter>(PlayerActor)->Controller->GetControlRotation());
FOutputDeviceNull AR;
const FString Command = FString::Printf(TEXT("PlayCameraShakeShoot"));
PlayerActor->CallFunctionByNameWithArguments(*Command, AR, nullptr, true);