Updated Interaction.cpp

Created camera movement functions and updating input disabler functions
This commit is contained in:
MH261677 2023-01-16 20:44:47 +00:00
parent 3752a24eab
commit 6f28d139ac
2 changed files with 16 additions and 3 deletions

View File

@ -8,7 +8,8 @@
#include "Components/Button.h"
#include "GameFramework/Character.h"
#include "Components/WidgetComponent.h"
#include "Evaluation/MovieSceneCameraAnimTemplate.h"
#include "Kismet/KismetMathLibrary.h"
// Sets default values
@ -34,6 +35,7 @@ void AInteraction::Tick(float DeltaTime)
void AInteraction::OnInteract()
{
bDisableShopDialMove = true;
ShopDialogWidget = CreateWidget<UUserWidget>(GetWorld(), ShopDialog);
if (ShopDialogWidget == nullptr)
{
@ -96,7 +98,11 @@ void AInteraction::CameraLeftMover()
}
else
{
UE_LOG(LogTemp, Display, TEXT("Camera functionality here in Interaction.cpp"));
FVector TargetLocation = FVector(1290, 530, 50);
FVector CameraLocation = MainCamera->GetComponentLocation();
FRotator CameraRotation = UKismetMathLibrary::FindLookAtRotation(CameraLocation, TargetLocation);
MainCamera->SetWorldRotation(CameraRotation);
MainCamera->SetFieldOfView(40);
}
}
}
@ -121,7 +127,11 @@ void AInteraction::CameraRightMover()
}
else
{
UE_LOG(LogTemp, Display, TEXT("Camera functionality here in Interaction.cpp"));
FVector TargetLocation = FVector(470, 510, 80);
FVector CameraLocation = MainCamera->GetComponentLocation();
FRotator CameraRotation = UKismetMathLibrary::FindLookAtRotation(CameraLocation, TargetLocation);
MainCamera->SetWorldRotation(CameraRotation);
MainCamera->SetFieldOfView(40);
}
}
}

View File

@ -46,6 +46,9 @@ public:
UPROPERTY()
bool bisDisabled = false;
UPROPERTY()
bool bDisableShopDialMove = false;
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
virtual void CameraLeftMover();