Compare commits
2 Commits
c1afc827e0
...
ff5c28ad05
Author | SHA1 | Date | |
---|---|---|---|
ff5c28ad05 | |||
3134e269f7 |
BIN
Content/AnimStarterPack/Hit_React_1_Montage.uasset
(Stored with Git LFS)
Normal file
BIN
Content/AnimStarterPack/Hit_React_1_Montage.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/AnimStarterPack/Hit_React_2_Montage.uasset
(Stored with Git LFS)
Normal file
BIN
Content/AnimStarterPack/Hit_React_2_Montage.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/AnimStarterPack/Hit_React_3_Montage.uasset
(Stored with Git LFS)
Normal file
BIN
Content/AnimStarterPack/Hit_React_3_Montage.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/AnimStarterPack/Hit_React_4_Montage.uasset
(Stored with Git LFS)
Normal file
BIN
Content/AnimStarterPack/Hit_React_4_Montage.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/Player/PlayerCharacter.uasset
(Stored with Git LFS)
BIN
Content/Player/PlayerCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "PlayerCharacter.h"
|
#include "PlayerCharacter.h"
|
||||||
// You can remove these, this is just to get intellisense to work
|
// You can remove these, this is just to get intellisense to work
|
||||||
#include <string>
|
|
||||||
#include <Components/CapsuleComponent.h>
|
#include <Components/CapsuleComponent.h>
|
||||||
#include <Kismet/GameplayStatics.h>
|
#include <Kismet/GameplayStatics.h>
|
||||||
|
|
||||||
@ -444,6 +443,14 @@ void APlayerCharacter::ProcessHits(TArray<FHitResult> hits)
|
|||||||
void APlayerCharacter::OnDamaged()
|
void APlayerCharacter::OnDamaged()
|
||||||
{
|
{
|
||||||
Super::OnDamaged();
|
Super::OnDamaged();
|
||||||
|
|
||||||
|
int32 randomAnimMontage = FMath::RandRange(0,OnDamagedHitAnimMontages.Num()-1);
|
||||||
|
|
||||||
|
if (OnDamagedHitAnimMontages[randomAnimMontage] != nullptr)
|
||||||
|
{
|
||||||
|
//TODO: Disable movement while playing animation montage
|
||||||
|
PlayAnimMontage(OnDamagedHitAnimMontages[randomAnimMontage]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerCharacter::OnDeath()
|
void APlayerCharacter::OnDeath()
|
||||||
|
@ -89,6 +89,9 @@ public:
|
|||||||
UPROPERTY(EditDefaultsOnly)
|
UPROPERTY(EditDefaultsOnly)
|
||||||
UAnimMontage* ThrowExplosiveAnimMontage;
|
UAnimMontage* ThrowExplosiveAnimMontage;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly)
|
||||||
|
TArray<UAnimMontage*> OnDamagedHitAnimMontages;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||||
float SprintSpeedMultiplier = 2.0f;
|
float SprintSpeedMultiplier = 2.0f;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user