117 - Reload Effects

This commit is contained in:
Kingsmedia 2022-05-10 00:35:33 +02:00
parent d7539845c6
commit bfe46a2e91
7 changed files with 20 additions and 1 deletions

View File

@ -76,4 +76,6 @@ void UBlasterAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
}
bUseFABRIK = BlasterCharacter->GetCombatState() != ECombatState::ECS_Reloading;
bUseAimOffsets = BlasterCharacter->GetCombatState() != ECombatState::ECS_Reloading;
bTransformRightHand = BlasterCharacter->GetCombatState() != ECombatState::ECS_Reloading;
}

View File

@ -82,4 +82,10 @@ private:
UPROPERTY(BlueprintReadOnly, Category="Movement", meta=(AllowPrivateAccess = "true"))
bool bUseFABRIK;
UPROPERTY(BlueprintReadOnly, Category="Movement", meta=(AllowPrivateAccess = "true"))
bool bUseAimOffsets;
UPROPERTY(BlueprintReadOnly, Category="Movement", meta=(AllowPrivateAccess = "true"))
bool bTransformRightHand;
};

View File

@ -325,7 +325,11 @@ void UCombatComponent::EquipWeapon(AWeapon* WeaponToEquip)
{
Controller->SetHUDCarriedAmmo(CarriedAmmo);
}
if (EquippedWeapon->EquipSound)
{
UGameplayStatics::PlaySoundAtLocation(this, EquippedWeapon->EquipSound, Character->GetActorLocation());
}
Character->GetCharacterMovement()->bOrientRotationToMovement = false;
Character->bUseControllerRotationYaw = true;
}
@ -427,6 +431,10 @@ void UCombatComponent::OnRep_EquippedWeapon()
{
HandSocket->AttachActor(EquippedWeapon, Character->GetMesh());
}
if (EquippedWeapon->EquipSound)
{
UGameplayStatics::PlaySoundAtLocation(this, EquippedWeapon->EquipSound, Character->GetActorLocation());
}
Character->GetCharacterMovement()->bOrientRotationToMovement = false;
Character->bUseControllerRotationYaw = true;
}

View File

@ -60,6 +60,9 @@ public:
UPROPERTY(EditAnywhere, Category = Combat)
bool bAutomatic = true;
UPROPERTY(EditAnywhere)
class USoundCue* EquipSound;
UPROPERTY(EditAnywhere, Category = Combat)
float FireDelay = .15f;