diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index aed31e5..f6c743b 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -24,6 +24,7 @@ void ATempCharacter::BeginPlay() { Super::BeginPlay(); Health = 100; + ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>()); } //Binds the input we made in the setup player component to the forward vector @@ -147,7 +148,6 @@ void ATempCharacter::InputDisabler() GetWorld()->GetFirstPlayerController()->bShowMouseCursor = true; GetWorld()->GetFirstPlayerController()->bEnableClickEvents = true; GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = true; - ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>()); if (ThisCamera == nullptr) { return; @@ -173,7 +173,6 @@ void ATempCharacter::InputEnabler() GetWorld()->GetFirstPlayerController()->bEnableMouseOverEvents = false; //GetWorld()->GetFirstPlayerController()->InputComponent->BindAction("Interact", IE_Pressed, this, &ATempCharacter::KeyPressed); TraceDistance = 300; - ThisCamera = Cast<UCameraComponent>(this->FindComponentByClass<UCameraComponent>()); if (ThisCamera == nullptr) { return;