From d3ba88cb3a4c0cf568bf0f5e67ccfb7f7ea3b249 Mon Sep 17 00:00:00 2001 From: baz Date: Wed, 24 Jan 2024 17:20:26 +0000 Subject: [PATCH] Add sprinting animation --- Content/AnimStarterPack/UE4ASP_HeroTPP_AnimBlueprint.uasset | 4 ++-- Source/Nakatomi/PlayerCharacter.cpp | 4 ++++ Source/Nakatomi/PlayerCharacter.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Content/AnimStarterPack/UE4ASP_HeroTPP_AnimBlueprint.uasset b/Content/AnimStarterPack/UE4ASP_HeroTPP_AnimBlueprint.uasset index 47d055b..d9b4e85 100644 --- a/Content/AnimStarterPack/UE4ASP_HeroTPP_AnimBlueprint.uasset +++ b/Content/AnimStarterPack/UE4ASP_HeroTPP_AnimBlueprint.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c58082295ea5ce5e827c027c20b024412395b158b2b9665c93464903897b47a3 -size 361824 +oid sha256:90f9e56a1bd04289e343998945cbcfca10ba5ca1a42a8e5a380ad0a842719cbf +size 416142 diff --git a/Source/Nakatomi/PlayerCharacter.cpp b/Source/Nakatomi/PlayerCharacter.cpp index 5e56081..8e892ea 100644 --- a/Source/Nakatomi/PlayerCharacter.cpp +++ b/Source/Nakatomi/PlayerCharacter.cpp @@ -299,6 +299,8 @@ void APlayerCharacter::SetSprintingCallback(const FInputActionInstance& Instance { cmc->EnableSprint(); } + + IsSprinting = true; } void APlayerCharacter::SetWalkingCallback(const FInputActionInstance& Instance) @@ -307,6 +309,8 @@ void APlayerCharacter::SetWalkingCallback(const FInputActionInstance& Instance) { cmc->DisableSprint(); } + + IsSprinting = false; } void APlayerCharacter::CalculateHits(TArray* hits) diff --git a/Source/Nakatomi/PlayerCharacter.h b/Source/Nakatomi/PlayerCharacter.h index e5c1c11..de44e91 100644 --- a/Source/Nakatomi/PlayerCharacter.h +++ b/Source/Nakatomi/PlayerCharacter.h @@ -121,6 +121,7 @@ private: UPROPERTY(EditAnywhere, BlueprintReadWrite, Meta = (AllowPrivateAccess = "true")) UAIPerceptionStimuliSourceComponent* PerceptionSource; + UPROPERTY(BlueprintReadOnly, Meta = (AllowPrivateAccess = "true")) bool IsSprinting = false; bool IsADS = false;