Compare commits
2 Commits
c1afc827e0
...
ff5c28ad05
Author | SHA1 | Date |
---|---|---|
baz | ff5c28ad05 | |
baz | 3134e269f7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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"
|
||||
// You can remove these, this is just to get intellisense to work
|
||||
#include <string>
|
||||
#include <Components/CapsuleComponent.h>
|
||||
#include <Kismet/GameplayStatics.h>
|
||||
|
||||
|
@ -444,6 +443,14 @@ void APlayerCharacter::ProcessHits(TArray<FHitResult> hits)
|
|||
void APlayerCharacter::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()
|
||||
|
|
|
@ -89,6 +89,9 @@ public:
|
|||
UPROPERTY(EditDefaultsOnly)
|
||||
UAnimMontage* ThrowExplosiveAnimMontage;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly)
|
||||
TArray<UAnimMontage*> OnDamagedHitAnimMontages;
|
||||
|
||||
protected:
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
float SprintSpeedMultiplier = 2.0f;
|
||||
|
|
Loading…
Reference in New Issue