Bugfix Able to Pickup Rifle Weapon & Switch w/ Secondary
This commit is contained in:
		
							parent
							
								
									2c088ffb02
								
							
						
					
					
						commit
						2b9ca4c312
					
				
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/FirstPerson/Blueprints/BP_MainCharacter.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/Levels/TempLevels/NewTutorialMap.umap
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/Levels/TempLevels/NewTutorialMap.umap
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/D/OU/O2HH4HR7YM08QPG8R3YF3R.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/MovementTest/D/OU/O2HH4HR7YM08QPG8R3YF3R.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							@ -487,10 +487,10 @@ void AEndlessVendettaCharacter::EquipPrimary()
 | 
			
		||||
	if (bIsReloading) return;
 | 
			
		||||
	if (IsValid(PrimaryWeapon))
 | 
			
		||||
	{
 | 
			
		||||
		TempUnequippedPrimary();
 | 
			
		||||
		//TempUnequippedPrimary();
 | 
			
		||||
		GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("IsPrimaryWeapon valid check running"));
 | 
			
		||||
		PrimaryWeapon->DetachFromActor(DetatchRules);
 | 
			
		||||
		PrimaryWeapon->AttachToComponent(FirstPersonArms, AttachmentRules, FName("UnEquipGunSocket"));
 | 
			
		||||
		//PrimaryWeapon->DetachFromActor(DetatchRules);
 | 
			
		||||
		//PrimaryWeapon->AttachToComponent(FirstPersonArms, AttachmentRules, FName("UnEquipGunSocket"));
 | 
			
		||||
		PrimaryWeapon->SetActorHiddenInGame(true);
 | 
			
		||||
		PrimaryWeapon->SetActorEnableCollision(false);
 | 
			
		||||
		this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
 | 
			
		||||
@ -520,9 +520,11 @@ void AEndlessVendettaCharacter::EquipPrimary()
 | 
			
		||||
 | 
			
		||||
		if (!bIsPrimaryWeaponCreated)
 | 
			
		||||
		{
 | 
			
		||||
			PrimaryWeaponActor = GetWorld()->SpawnActor<AActor>(PrimaryWeaponClass, spawnParams);
 | 
			
		||||
			//PrimaryWeaponActor = GetWorld()->SpawnActor<AActor>(PrimaryWeaponClass, spawnParams);
 | 
			
		||||
			HeldWeapon->SetChildActorClass(PrimaryWeaponClass);
 | 
			
		||||
			PrimaryWeaponActor = HeldWeapon->GetChildActor();
 | 
			
		||||
			GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Red, TEXT("Spawning weapon"));
 | 
			
		||||
			PrimaryWeaponActor->AttachToComponent(FirstPersonArms, AttachmentRules, FName("GripPoint"));
 | 
			
		||||
			//PrimaryWeaponActor->AttachToComponent(FirstPersonArms, AttachmentRules, FName("GripPoint"));
 | 
			
		||||
			PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
 | 
			
		||||
			PrimaryWeapon->SetActorHiddenInGame(false);
 | 
			
		||||
			PrimaryWeapon->SetActorEnableCollision(false);
 | 
			
		||||
@ -535,15 +537,17 @@ void AEndlessVendettaCharacter::EquipPrimary()
 | 
			
		||||
	if (PrimaryWeaponClass != nullptr)
 | 
			
		||||
	{
 | 
			
		||||
		GEngine->AddOnScreenDebugMessage(-1, 15.f, FColor::Green, TEXT("non ifstatement code running"));
 | 
			
		||||
		PrimaryWeaponActor->AttachToComponent(FirstPersonArms, AttachmentRules, FName("GripPoint"));
 | 
			
		||||
		//PrimaryWeaponActor->AttachToComponent(FirstPersonArms, AttachmentRules, FName("GripPoint"));
 | 
			
		||||
		HeldWeapon->SetChildActorClass(PrimaryWeaponClass);
 | 
			
		||||
		PrimaryWeaponActor = HeldWeapon->GetChildActor();
 | 
			
		||||
		PrimaryWeapon = Cast<ABaseWeaponClass>(PrimaryWeaponActor);
 | 
			
		||||
		PrimaryWeapon->SetActorHiddenInGame(false);
 | 
			
		||||
		PrimaryWeapon->SetActorEnableCollision(false);
 | 
			
		||||
		GetWorldTimerManager().ClearTimer(PrimaryWeapon->reloadTimerHandle);
 | 
			
		||||
		//GetWorldTimerManager().ClearTimer(PrimaryWeapon->reloadTimerHandle);
 | 
			
		||||
		bIsCurrentlyHoldingWeapon = true;
 | 
			
		||||
		bHasRifle = true;
 | 
			
		||||
		SetOverlayState(EOverlayState::AssaultRifle);
 | 
			
		||||
		TempEquippedPrimary();
 | 
			
		||||
		//TempEquippedPrimary();
 | 
			
		||||
		EquippedWeapon.Broadcast();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@ -598,6 +602,8 @@ void AEndlessVendettaCharacter::EquipSecondary()
 | 
			
		||||
	}
 | 
			
		||||
	if (SecondaryWeaponClass != nullptr)
 | 
			
		||||
	{
 | 
			
		||||
		HeldWeapon->SetChildActorClass(SecondaryWeaponClass);
 | 
			
		||||
		SecondaryWeaponActor = HeldWeapon->GetChildActor();
 | 
			
		||||
		SecondaryWeapon = Cast<ABaseWeaponClass>(SecondaryWeaponActor);
 | 
			
		||||
		SecondaryWeapon->SetActorHiddenInGame(false);
 | 
			
		||||
		bIsCurrentlyHoldingWeapon = true;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user