Update Pistol for Arms & Gun Fire Animation

This commit is contained in:
Philip W 2024-03-08 01:25:16 +00:00
parent 1fd59390ff
commit 4fdd640562
17 changed files with 40 additions and 39 deletions

Binary file not shown.

View File

@ -70,7 +70,6 @@ void AMyVICharacterBase::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& O
void AMyVICharacterBase::Jump() void AMyVICharacterBase::Jump()
{ {
if (PlayerOnShip || InPauseMenu) return;
// If missing critical components then jump and exit // If missing critical components then jump and exit
if (!VaultComponent || !GetCharacterMovement()) if (!VaultComponent || !GetCharacterMovement())
{ {
@ -212,7 +211,7 @@ bool AMyVICharacterBase::CanVault_Implementation() const
} }
// Animation instance is required to play vault montage // Animation instance is required to play vault montage
if (!IsValid(FP_SkeletalMesh) || !IsValid(FP_SkeletalMesh->GetAnimInstance())) if (!GetMesh() || !GetMesh()->GetAnimInstance())
{ {
UE_LOG(LogTemp, Warning, TEXT("Animation instance is required to play vault montage")); UE_LOG(LogTemp, Warning, TEXT("Animation instance is required to play vault montage"));
return false; return false;

View File

@ -20,7 +20,7 @@ class UVIPawnVaultComponent;
* Requires multiple overrides which will cause errors if not correctly performed * Requires multiple overrides which will cause errors if not correctly performed
*/ */
UCLASS(abstract) UCLASS(abstract)
class ENDLESSVENDETTA_API AMyVICharacterBase : public ABountyHunterCharacter, public IVIPawnInterface class ENDLESSVENDETTA_API AMyVICharacterBase : public ACharacter, public IVIPawnInterface
{ {
GENERATED_BODY() GENERATED_BODY()
@ -101,7 +101,7 @@ public:
virtual UVIPawnVaultComponent* GetPawnVaultComponent_Implementation() const override; virtual UVIPawnVaultComponent* GetPawnVaultComponent_Implementation() const override;
virtual UMotionWarpingComponent* GetMotionWarpingComponent_Implementation() const override; virtual UMotionWarpingComponent* GetMotionWarpingComponent_Implementation() const override;
virtual USkeletalMeshComponent* GetMeshForVaultMontage_Implementation() const override { return FP_SkeletalMesh; } virtual USkeletalMeshComponent* GetMeshForVaultMontage_Implementation() const override { return GetMesh(); }
virtual FVIAnimSet GetVaultAnimSet_Implementation() const override; virtual FVIAnimSet GetVaultAnimSet_Implementation() const override;
virtual FVITraceSettings GetVaultTraceSettings_Implementation() const override; virtual FVITraceSettings GetVaultTraceSettings_Implementation() const override;
virtual FVector GetVaultDirection_Implementation() const override; virtual FVector GetVaultDirection_Implementation() const override;

View File

@ -79,18 +79,6 @@ void AEndlessVendettaCharacter::BeginPlay()
SecondaryWeaponClass = GI->MainSaveGameInstanceRef->SecondaryWeaponClassSave; SecondaryWeaponClass = GI->MainSaveGameInstanceRef->SecondaryWeaponClassSave;
} }
// Set the fp skeletal mesh for the vault it plugin to use
TArray<UActorComponent*> MeshActComps = GetComponentsByClass(USkeletalMeshComponent::StaticClass());
for (auto MeshActorComponent : MeshActComps)
{
USkeletalMeshComponent* MeshSkeletalComp = Cast<USkeletalMeshComponent>(MeshActorComponent);
if (MeshSkeletalComp->ComponentHasTag("FP_Mesh"))
{
FP_SkeletalMesh = MeshSkeletalComp;
break;
}
}
//Add Input Mapping Context //Add Input Mapping Context
if (APlayerController* PlayerController = Cast<APlayerController>(Controller)) if (APlayerController* PlayerController = Cast<APlayerController>(Controller))
{ {
@ -103,14 +91,14 @@ void AEndlessVendettaCharacter::BeginPlay()
GadgetManager = Cast<AGadgetManager>(GadgetManagerActor); GadgetManager = Cast<AGadgetManager>(GadgetManagerActor);
FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true); FAttachmentTransformRules AttachmentRules(EAttachmentRule::SnapToTarget, true);
GadgetManagerActor->AttachToComponent(GetRootComponent(), AttachmentRules); GadgetManagerActor->AttachToComponent(GetRootComponent(), AttachmentRules);
for (UActorComponent* PlayersCamera : GetComponentsByTag(UCameraComponent::StaticClass(), FName("PlayersCamera"))) UCameraComponent* CameraComponent = Cast<UCameraComponent>(GetComponentByClass(UCameraComponent::StaticClass()));
if (IsValid(CameraComponent))
{ {
FirstPersonCameraComponent = Cast<UCameraComponent>(PlayersCamera); FirstPersonCameraComponent = CameraComponent;
GadgetManager->SpawnGadgetsOnBeginPlay(Cast<USceneComponent>(PlayersCamera)); GadgetManager->SpawnGadgetsOnBeginPlay(CameraComponent);
break;
} }
InventoryComponent = Cast<UInventoryComponent>(GetWorld()->GetFirstPlayerController()->GetComponentByClass(UInventoryComponent::StaticClass())); InventoryComponent = Cast<UInventoryComponent>(GetComponentByClass(UInventoryComponent::StaticClass()));
WalkSpeed = CharacterMovement->MaxWalkSpeed; WalkSpeed = CharacterMovement->MaxWalkSpeed;
OriginalWalkSpeed = CharacterMovement->MaxWalkSpeed; OriginalWalkSpeed = CharacterMovement->MaxWalkSpeed;
CurrentStamina = MaxStamina; CurrentStamina = MaxStamina;

View File

@ -253,10 +253,6 @@ protected:
UFUNCTION(BlueprintImplementableEvent) UFUNCTION(BlueprintImplementableEvent)
void StoppedHoldingInteract(); void StoppedHoldingInteract();
protected:
// Used by vault it plugin to run vaulting animations
USkeletalMeshComponent* FP_SkeletalMesh = nullptr;
// APawn interface // APawn interface
virtual void SetupPlayerInputComponent(UInputComponent* InputComponent) override; virtual void SetupPlayerInputComponent(UInputComponent* InputComponent) override;
// End of APawn interface // End of APawn interface