Bugfix Able to Equip Rifle Before Pickup
This commit is contained in:
parent
7aecf2a69c
commit
05679cc334
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Pine.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Pine.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Walnut.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Materials/M_Wood_Walnut.uasset
(Stored with Git LFS)
Binary file not shown.
@ -306,17 +306,18 @@ void AEndlessVendettaCharacter::EquipPrimary()
|
|||||||
if (GadgetManager->IsValidCombatGadget() && GadgetManager->IsCombatEquipped() && !GadgetManager->TryToUnequipCombat()) return;
|
if (GadgetManager->IsValidCombatGadget() && GadgetManager->IsCombatEquipped() && !GadgetManager->TryToUnequipCombat()) return;
|
||||||
|
|
||||||
bHasRifle = true;
|
bHasRifle = true;
|
||||||
if(!bIsPrimaryWeaponCreated)
|
// if(!bIsPrimaryWeaponCreated)
|
||||||
{
|
// {
|
||||||
//Creating a new actor object called PrimaryWeapon that is based off primaryweaponClass
|
// //Creating a new actor object called PrimaryWeapon that is based off primaryweaponClass
|
||||||
//Changing PrimaryWeaponActor to ABaseWeaponClass type instead of actor and storing it into PrimaryWeapon which is a ABaseClass Object
|
// //Changing PrimaryWeaponActor to ABaseWeaponClass type instead of actor and storing it into PrimaryWeapon which is a ABaseClass Object
|
||||||
//We do this because we need to check if PrimaryWeapon is equipped and we want primaryweapon to be ABaseWeapon type and not a generic AActor
|
// //We do this because we need to check if PrimaryWeapon is equipped and we want primaryweapon to be ABaseWeapon type and not a generic AActor
|
||||||
PrimaryWeaponActor = GetWorld()->SpawnActor<AActor>(PrimaryWeaponClass, spawnParams);
|
// PrimaryWeaponActor = GetWorld()->SpawnActor<AActor>(PrimaryWeaponClass, spawnParams);
|
||||||
PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
|
// PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
|
||||||
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
|
// PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
|
||||||
PrimaryWeapon->SetActorHiddenInGame(false);
|
// PrimaryWeapon->SetActorHiddenInGame(false);
|
||||||
bIsPrimaryWeaponCreated = true;
|
// bIsPrimaryWeaponCreated = true;
|
||||||
}
|
// }
|
||||||
|
if (!IsValid(PrimaryWeaponActor)) return;
|
||||||
PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
|
PrimaryWeaponActor->AttachToComponent(Mesh1P, AttachmentRules, FName("GripPoint"));
|
||||||
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
|
PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
|
||||||
PrimaryWeapon->SetActorHiddenInGame(false);
|
PrimaryWeapon->SetActorHiddenInGame(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user