Added FOV Fixes to sprint bar
This commit is contained in:
		
							parent
							
								
									c9acf07ccd
								
							
						
					
					
						commit
						b3b2dac792
					
				| @ -86,6 +86,7 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) | ||||
| 	} | ||||
| 	else if (MoveGroundSpeed <= 0) | ||||
| 	{ | ||||
| 		this->GetFirstPersonCameraComponent()->SetFieldOfView(90); | ||||
| 		bIsPlayerMoving = false; | ||||
| 	} | ||||
| 	if (bPressedJump) | ||||
| @ -96,6 +97,8 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) | ||||
| 		} | ||||
| 	} | ||||
| 	//PLAYER STAMINA HANDLING
 | ||||
| 	if (MoveGroundSpeed > 0) | ||||
| 	{ | ||||
| 		if (bIsPlayerSprinting) | ||||
| 		{ | ||||
| 			CurrentStamina -= FMath::Clamp(StaminaDecreaseRate, 0.0f, 100.0f); | ||||
| @ -107,6 +110,7 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime) | ||||
| 				CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed; | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	if (!bIsPlayerSprinting) | ||||
| 	{ | ||||
| 		if(CurrentStamina >= 100.0f) | ||||
| @ -546,11 +550,14 @@ void AEndlessVendettaCharacter::Sprint() | ||||
| { | ||||
| 	bIsPlayerSprinting = true; | ||||
| 	if (bIsPlayerSprinting) | ||||
| 	{ | ||||
| 		if (MoveGroundSpeed > 0) | ||||
| 		{ | ||||
| 			CharacterMovement->MaxWalkSpeed = SprintSpeed; | ||||
| 			this->GetFirstPersonCameraComponent()->SetFieldOfView(100); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| void AEndlessVendettaCharacter::StopSprint() | ||||
| { | ||||
| @ -565,7 +572,7 @@ void AEndlessVendettaCharacter::StopSprint() | ||||
| 
 | ||||
| void AEndlessVendettaCharacter::Jumping() | ||||
| { | ||||
| 	if (CurrentStamina > 20.0f) | ||||
| 	if (CurrentStamina > 10.0f) | ||||
| 	{ | ||||
| 		bHasPlayerJumped = true; | ||||
| 		if (bHasPlayerJumped) | ||||
| @ -573,7 +580,7 @@ void AEndlessVendettaCharacter::Jumping() | ||||
| 			Super::Jump(); | ||||
| 			if (!CharacterMovement->IsFalling()) | ||||
| 			{ | ||||
| 				CurrentStamina -= 20.0f; | ||||
| 				CurrentStamina -= 10.0f; | ||||
| 			} | ||||
| 			bHasPlayerJumped = false; | ||||
| 		} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user