Fixed More FOV issues and removed FOV when Sprinting

This commit is contained in:
MH261677 2023-12-12 11:39:52 +00:00
parent 3395c2083a
commit cdac36f359
3 changed files with 3 additions and 7 deletions

Binary file not shown.

View File

@ -86,7 +86,6 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime)
} }
else if (MoveGroundSpeed <= 0) else if (MoveGroundSpeed <= 0)
{ {
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
bIsPlayerMoving = false; bIsPlayerMoving = false;
} }
if (bPressedJump) if (bPressedJump)
@ -105,7 +104,6 @@ void AEndlessVendettaCharacter::Tick(float DeltaTime)
if (CurrentStamina <= 0.0f) if (CurrentStamina <= 0.0f)
{ {
bIsPlayerSprinting = false; bIsPlayerSprinting = false;
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
CurrentStamina = 0.0f; CurrentStamina = 0.0f;
CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed; CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed;
} }
@ -554,7 +552,6 @@ void AEndlessVendettaCharacter::Sprint()
if (MoveGroundSpeed > 0) if (MoveGroundSpeed > 0)
{ {
CharacterMovement->MaxWalkSpeed = SprintSpeed; CharacterMovement->MaxWalkSpeed = SprintSpeed;
this->GetFirstPersonCameraComponent()->SetFieldOfView(100);
} }
} }
} }
@ -566,7 +563,6 @@ void AEndlessVendettaCharacter::StopSprint()
{ {
UE_LOG(LogTemp, Display, TEXT("Player stopped sprinting")); UE_LOG(LogTemp, Display, TEXT("Player stopped sprinting"));
CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed; CharacterMovement->MaxWalkSpeed = OriginalWalkSpeed;
this->GetFirstPersonCameraComponent()->SetFieldOfView(90);
} }
} }
@ -590,7 +586,6 @@ void AEndlessVendettaCharacter::Jumping()
void AEndlessVendettaCharacter::StopJump() void AEndlessVendettaCharacter::StopJump()
{ {
Super::StopJumping(); Super::StopJumping();
UE_LOG(LogTemp, Display, TEXT("Player has stopped jumping"));
bHasPlayerJumped = false; bHasPlayerJumped = false;
} }

View File

@ -127,7 +127,7 @@ public:
bool bIsPlayerMoving = false; bool bIsPlayerMoving = false;
UPROPERTY(VisibleAnywhere) UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
bool bIsPlayerSprinting = false; bool bIsPlayerSprinting = false;
double MoveGroundSpeed; double MoveGroundSpeed;
@ -177,6 +177,7 @@ public:
void Jumping(); void Jumping();
void StopJump(); void StopJump();
UPROPERTY(BlueprintReadWrite)
bool bHasPlayerJumped = false; bool bHasPlayerJumped = false;
UArrowComponent* ScopedLocationArrow; UArrowComponent* ScopedLocationArrow;