Bugfix Camera Being Reset in Wrong Positions and FOV
This commit is contained in:
parent
e947b67b36
commit
0c3831ad03
BIN
Content/Blueprints/Player/BP_MyTempCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Player/BP_MyTempCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -262,7 +262,7 @@ void ATempCharacter::AddToInventory()
|
||||
}
|
||||
}
|
||||
|
||||
void ATempCharacter::InputDisabler()
|
||||
void ATempCharacter::InputDisabler(const bool SetCamera)
|
||||
{
|
||||
CrossHairWidget->SetVisibility(ESlateVisibility::Hidden);
|
||||
|
||||
@ -274,7 +274,7 @@ void ATempCharacter::InputDisabler()
|
||||
PlayerController->SetIgnoreLookInput(true);
|
||||
|
||||
disableTab = true;
|
||||
if (ThisCamera != nullptr)
|
||||
if (ThisCamera != nullptr && SetCamera)
|
||||
{
|
||||
OriginalCameraLocation = ThisCamera->GetComponentLocation();
|
||||
OriginalCameraRotation = ThisCamera->GetComponentRotation();
|
||||
@ -283,7 +283,7 @@ void ATempCharacter::InputDisabler()
|
||||
}
|
||||
}
|
||||
|
||||
void ATempCharacter::InputEnabler()
|
||||
void ATempCharacter::InputEnabler(const bool SetCamera)
|
||||
{
|
||||
//Reset UI Mode
|
||||
APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();
|
||||
@ -302,7 +302,7 @@ void ATempCharacter::InputEnabler()
|
||||
UE_LOG(LogTemp, Display, TEXT("Enabling Inputs"));
|
||||
disableTab = true;
|
||||
TraceDistance = 300;
|
||||
if (ThisCamera != nullptr)
|
||||
if (ThisCamera != nullptr && SetCamera)
|
||||
{
|
||||
ThisCamera->SetWorldLocation(OriginalCameraLocation);
|
||||
ThisCamera->SetWorldRotation(OriginalCameraRotation);
|
||||
|
@ -66,7 +66,7 @@ public:
|
||||
float TraceDistance = 200;
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void InputDisabler();
|
||||
void InputDisabler(bool SetCamera = true);
|
||||
|
||||
void LineTraceLogic();
|
||||
|
||||
@ -87,7 +87,7 @@ public:
|
||||
void UseItem(class UBaseItem* Item); // Overriding the BaseItem Class
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void InputEnabler();
|
||||
void InputEnabler(bool SetCamera = true);
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera")
|
||||
UCameraComponent* ThisCamera;
|
||||
|
Loading…
Reference in New Issue
Block a user