diff --git a/Content/Blueprints/Character/Animation/BlasterAnimBP.uasset b/Content/Blueprints/Character/Animation/BlasterAnimBP.uasset index a180436..4d9b2dd 100644 Binary files a/Content/Blueprints/Character/Animation/BlasterAnimBP.uasset and b/Content/Blueprints/Character/Animation/BlasterAnimBP.uasset differ diff --git a/Content/Blueprints/Character/Animation/Reload.uasset b/Content/Blueprints/Character/Animation/Reload.uasset index 21ac83a..8cbda42 100644 Binary files a/Content/Blueprints/Character/Animation/Reload.uasset and b/Content/Blueprints/Character/Animation/Reload.uasset differ diff --git a/Content/Blueprints/Weapon/BP_AssaultRifle.uasset b/Content/Blueprints/Weapon/BP_AssaultRifle.uasset index 4189f77..677e41e 100644 Binary files a/Content/Blueprints/Weapon/BP_AssaultRifle.uasset and b/Content/Blueprints/Weapon/BP_AssaultRifle.uasset differ diff --git a/Source/Blaster/Character/BlasterAnimInstance.cpp b/Source/Blaster/Character/BlasterAnimInstance.cpp index f59c41e..50df4ce 100644 --- a/Source/Blaster/Character/BlasterAnimInstance.cpp +++ b/Source/Blaster/Character/BlasterAnimInstance.cpp @@ -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; } diff --git a/Source/Blaster/Character/BlasterAnimInstance.h b/Source/Blaster/Character/BlasterAnimInstance.h index fa6da7d..64293c1 100644 --- a/Source/Blaster/Character/BlasterAnimInstance.h +++ b/Source/Blaster/Character/BlasterAnimInstance.h @@ -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; }; diff --git a/Source/Blaster/Components/CombatComponent.cpp b/Source/Blaster/Components/CombatComponent.cpp index 5f4e2ca..bc6b062 100644 --- a/Source/Blaster/Components/CombatComponent.cpp +++ b/Source/Blaster/Components/CombatComponent.cpp @@ -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; } diff --git a/Source/Blaster/Weapon/Weapon.h b/Source/Blaster/Weapon/Weapon.h index de06f80..9472ed8 100644 --- a/Source/Blaster/Weapon/Weapon.h +++ b/Source/Blaster/Weapon/Weapon.h @@ -60,6 +60,9 @@ public: UPROPERTY(EditAnywhere, Category = Combat) bool bAutomatic = true; + + UPROPERTY(EditAnywhere) + class USoundCue* EquipSound; UPROPERTY(EditAnywhere, Category = Combat) float FireDelay = .15f;