Fixed Player BP Issues
This commit is contained in:
		
							parent
							
								
									0b12f2e0df
								
							
						
					
					
						commit
						3633e1fe24
					
				
							
								
								
									
										
											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/Architecture/Floor_400x400.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/AITest/0/30/II3E4UW0LD8MICL6FWYKWT.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/AITest/0/30/II3E4UW0LD8MICL6FWYKWT.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/AITest/3/YQ/PXB4WSHORDZW4LPFJWMR2F.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/AITest/3/YQ/PXB4WSHORDZW4LPFJWMR2F.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/AITest/4/LG/NYVOKCFE6YHCG70FME5BSE.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								EndlessVendetta/Content/__ExternalActors__/Levels/AITest/4/LG/NYVOKCFE6YHCG70FME5BSE.uasset
									 (Stored with Git LFS)
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@ -173,60 +173,61 @@ void ABaseWeaponClass::CancelFire()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void ABaseWeaponClass::Fire()
 | 
					void ABaseWeaponClass::Fire()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (currentAmmoCount > 0)
 | 
						if (currentAmmoCount <= 0)
 | 
				
			||||||
 | 
					 	{
 | 
				
			||||||
 | 
					 		UE_LOG(LogTemp, Display, TEXT("No ammo, Ammo count: %d"), currentAmmoCount);
 | 
				
			||||||
 | 
					 		ShowNeedReloadUI();
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
					 	}
 | 
				
			||||||
 | 
						if (GetWorldTimerManager().IsTimerActive(timerHandle)) return;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						//do damage fallof based off distance
 | 
				
			||||||
 | 
						UCameraComponent* CamComp = Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->GetFirstPersonCameraComponent();
 | 
				
			||||||
 | 
						traceStart = Cast<USkeletalMeshComponent>(GetComponentByClass(USkeletalMeshComponent::StaticClass()))->GetSocketLocation("Muzzle");
 | 
				
			||||||
 | 
						traceEnd = CamComp->GetComponentLocation() + CamComp->GetForwardVector() * BulletDistance;
 | 
				
			||||||
 | 
						FCollisionObjectQueryParams ObjectQueryParams;
 | 
				
			||||||
 | 
						ObjectQueryParams.AddObjectTypesToQuery(ECC_Pawn);
 | 
				
			||||||
 | 
						ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldStatic);
 | 
				
			||||||
 | 
						ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldDynamic);
 | 
				
			||||||
 | 
						GetWorld()->LineTraceSingleByObjectType(outHit, traceStart, traceEnd, ObjectQueryParams, collisionParams);
 | 
				
			||||||
 | 
						WeaponFired.Broadcast();
 | 
				
			||||||
 | 
						playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);
 | 
				
			||||||
 | 
						currentAmmoCount -= 1;
 | 
				
			||||||
 | 
						GenerateRecoilVector();
 | 
				
			||||||
 | 
						ClickDetectionTimer();
 | 
				
			||||||
 | 
						bulletCountShoot += 1;
 | 
				
			||||||
 | 
						bStopShooting = false;
 | 
				
			||||||
 | 
						if (outHit.bBlockingHit)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		//do damage fallof based off distance
 | 
							if (outHit.Distance >= FMath::Floor(BulletDistance / 2))
 | 
				
			||||||
		traceStart = Cast<USkeletalMeshComponent>(GetComponentByClass(USkeletalMeshComponent::StaticClass()))->GetSocketLocation("Muzzle");
 | 
					 | 
				
			||||||
		traceEnd = traceStart + Cast<AEndlessVendettaCharacter>(GetWorld()->GetFirstPlayerController()->GetPawn())->GetFirstPersonCameraComponent()->GetForwardVector() * BulletDistance;
 | 
					 | 
				
			||||||
		if (GetWorldTimerManager().IsTimerActive(timerHandle)) return;
 | 
					 | 
				
			||||||
		FCollisionObjectQueryParams ObjectQueryParams;
 | 
					 | 
				
			||||||
		ObjectQueryParams.AddObjectTypesToQuery(ECC_Pawn);
 | 
					 | 
				
			||||||
		ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldStatic);
 | 
					 | 
				
			||||||
		ObjectQueryParams.AddObjectTypesToQuery(ECC_WorldDynamic);
 | 
					 | 
				
			||||||
		GetWorld()->LineTraceSingleByObjectType(outHit, traceStart, traceEnd, ObjectQueryParams, collisionParams);
 | 
					 | 
				
			||||||
		WeaponFired.Broadcast();
 | 
					 | 
				
			||||||
		playerControllerRef->PlayerCameraManager->StartCameraShake(CameraShakeClass, 1);
 | 
					 | 
				
			||||||
		currentAmmoCount -= 1;
 | 
					 | 
				
			||||||
		GenerateRecoilVector();
 | 
					 | 
				
			||||||
		ClickDetectionTimer();
 | 
					 | 
				
			||||||
		bulletCountShoot += 1;
 | 
					 | 
				
			||||||
		bStopShooting = false;
 | 
					 | 
				
			||||||
		if (outHit.bBlockingHit)
 | 
					 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			if (outHit.Distance >= FMath::Floor(BulletDistance / 2))
 | 
								tempWeaponDamage = WeaponDamage / 2;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							else
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								tempWeaponDamage = WeaponDamage;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (Cast<AAICharacter>(outHit.GetActor()))
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								if (outHit.BoneName.ToString().ToLower() == "head")
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				tempWeaponDamage = WeaponDamage / 2;
 | 
									tempWeaponDamage *= 2;
 | 
				
			||||||
 | 
									endlessVendettaChar->SuccessfulHit(true);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			else
 | 
								else
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				tempWeaponDamage = WeaponDamage;
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			if (Cast<AAICharacter>(outHit.GetActor()))
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				if (outHit.BoneName.ToString().ToLower() == "head")
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					tempWeaponDamage *= 2;
 | 
					 | 
				
			||||||
					endlessVendettaChar->SuccessfulHit(true);
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				else
 | 
					 | 
				
			||||||
				{
 | 
					 | 
				
			||||||
					endlessVendettaChar->SuccessfulHit();
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				Cast<AAICharacter>(outHit.GetActor())->TakeDamage(tempWeaponDamage, FPointDamageEvent(), GetWorld()->GetFirstPlayerController(), this);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
			if (ATargetDummy* TargetDummy = Cast<ATargetDummy>(outHit.GetActor()))
 | 
					 | 
				
			||||||
			{
 | 
					 | 
				
			||||||
				TargetDummy->TargetShot();
 | 
					 | 
				
			||||||
				endlessVendettaChar->SuccessfulHit();
 | 
									endlessVendettaChar->SuccessfulHit();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
								Cast<AAICharacter>(outHit.GetActor())->TakeDamage(tempWeaponDamage, FPointDamageEvent(), GetWorld()->GetFirstPlayerController(), this);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if (ATargetDummy* TargetDummy = Cast<ATargetDummy>(outHit.GetActor()))
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								TargetDummy->TargetShot();
 | 
				
			||||||
 | 
								endlessVendettaChar->SuccessfulHit();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		HideNeedReloadUI();
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	else if (currentAmmoCount <= 0)
 | 
					 | 
				
			||||||
	{
 | 
					 | 
				
			||||||
		UE_LOG(LogTemp, Display, TEXT("No ammo, Ammo count: %d"), currentAmmoCount);
 | 
					 | 
				
			||||||
		ShowNeedReloadUI();
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						HideNeedReloadUI();
 | 
				
			||||||
 | 
						
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ABaseWeaponClass::WeaponScopedFire()
 | 
					void ABaseWeaponClass::WeaponScopedFire()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user