From deabd0b223883ae59390371221bcda6cbb042255 Mon Sep 17 00:00:00 2001 From: baz Date: Thu, 1 Feb 2024 01:00:47 +0000 Subject: [PATCH] Play Throw AnimMontage when throwing --- Content/AnimStarterPack/Throw_Montage.uasset | 4 ++-- Content/Player/PlayerCharacter.uasset | 4 ++-- Source/Nakatomi/PlayerCharacter.cpp | 4 ++++ Source/Nakatomi/PlayerCharacter.h | 3 +++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Content/AnimStarterPack/Throw_Montage.uasset b/Content/AnimStarterPack/Throw_Montage.uasset index be22ae9..6bd9f93 100644 --- a/Content/AnimStarterPack/Throw_Montage.uasset +++ b/Content/AnimStarterPack/Throw_Montage.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d45c12cf21d2f53a3f74c8caedebf045f2ab6d9eb3acbf84f1fbda0acd00942e -size 9358 +oid sha256:3dde76805f9477141189cd9cbb578e52e8055e4b7aa7d4fda45905ae68ca47a1 +size 9560 diff --git a/Content/Player/PlayerCharacter.uasset b/Content/Player/PlayerCharacter.uasset index b363e27..6d0c349 100644 --- a/Content/Player/PlayerCharacter.uasset +++ b/Content/Player/PlayerCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bbdd91730bd2d0f28990730f9e4a7f51af431c637221f9a4162184ba8320f394 -size 42184 +oid sha256:10ca86a5b20c35be232db419009efb431d7ff70da98e22a8150eb6ea9835bb56 +size 42384 diff --git a/Source/Nakatomi/PlayerCharacter.cpp b/Source/Nakatomi/PlayerCharacter.cpp index a73b591..ebaab89 100644 --- a/Source/Nakatomi/PlayerCharacter.cpp +++ b/Source/Nakatomi/PlayerCharacter.cpp @@ -703,6 +703,8 @@ void APlayerCharacter::ThrowWeaponCallback() { if (CurrentWeapon) { + PlayAnimMontage(ThrowAnimMontage); + FVector Location; FVector BoxExtent; GetActorBounds(true, Location, BoxExtent, false); @@ -726,6 +728,8 @@ void APlayerCharacter::ThrowExplosiveCallback() { if (ThrowableInventory.Num() > 0) { + PlayAnimMontage(ThrowAnimMontage); + FVector Location; FVector BoxExtent; GetActorBounds(true, Location, BoxExtent, false); diff --git a/Source/Nakatomi/PlayerCharacter.h b/Source/Nakatomi/PlayerCharacter.h index 76e941e..d9b5e4a 100644 --- a/Source/Nakatomi/PlayerCharacter.h +++ b/Source/Nakatomi/PlayerCharacter.h @@ -83,6 +83,9 @@ public: FOnEnemyHitDelegate OnEnemyHit; + UPROPERTY(EditDefaultsOnly) + UAnimMontage* ThrowAnimMontage; + protected: UPROPERTY(EditDefaultsOnly, BlueprintReadWrite) float SprintSpeedMultiplier = 2.0f;