diff --git a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp index e61e068f..d8b4f99e 100644 --- a/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/EndlessVendettaCharacter.cpp @@ -361,8 +361,9 @@ void AEndlessVendettaCharacter::EquipPrimary() if (IsValid(PrimaryWeapon)) { PrimaryWeapon->DetachFromActor(DetatchRules); - PrimaryWeapon->SetActorLocation(FVector(0, 0, 0), false, nullptr, ETeleportType::None); + PrimaryWeapon->AttachToComponent(Mesh1P, AttachmentRules, FName("UnEquipGunSocket")); PrimaryWeapon->SetActorHiddenInGame(true); + PrimaryWeapon->SetActorEnableCollision(false); this->GetFirstPersonCameraComponent()->SetFieldOfView(90); UE_LOG(LogTemp, Warning, TEXT("Primary Weapon Is Hidden: %hhd"), PrimaryWeapon->IsHidden()); PrimaryWeapon = nullptr; @@ -414,9 +415,9 @@ void AEndlessVendettaCharacter::EquipSecondary() if (bIsReloading) return; if (IsValid(SecondaryWeapon)) { - SecondaryWeapon->DetachFromActor(DetatchRules); - SecondaryWeapon->SetActorLocation(FVector(0, 0, 0), false, nullptr, ETeleportType::None); + SecondaryWeapon->AttachToComponent(Mesh1P, AttachmentRules, FName("UnEquipGunSocket")); SecondaryWeapon->SetActorHiddenInGame(true); + SecondaryWeapon->SetActorEnableCollision(false); this->GetFirstPersonCameraComponent()->SetFieldOfView(90); UE_LOG(LogTemp, Warning, TEXT("Secondary Weapon Is Hidden: %hhd"), SecondaryWeapon->IsHidden()); SecondaryWeapon = nullptr;