diff --git a/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp b/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp index b6f63ab..86044f6 100644 --- a/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp +++ b/Source/the_twilight_abyss/MerchantInteraction/Interaction.cpp @@ -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(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); } } } diff --git a/Source/the_twilight_abyss/MerchantInteraction/Interaction.h b/Source/the_twilight_abyss/MerchantInteraction/Interaction.h index 4231b2a..fb771a9 100644 --- a/Source/the_twilight_abyss/MerchantInteraction/Interaction.h +++ b/Source/the_twilight_abyss/MerchantInteraction/Interaction.h @@ -46,6 +46,9 @@ public: UPROPERTY() bool bisDisabled = false; + UPROPERTY() + bool bDisableShopDialMove = false; + UFUNCTION(BlueprintCallable, Category= "ButtonLeft") virtual void CameraLeftMover();