Updated Interaction.cpp
Created camera movement functions and updating input disabler functions
This commit is contained in:
parent
3752a24eab
commit
6f28d139ac
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,9 @@ public:
|
||||
UPROPERTY()
|
||||
bool bisDisabled = false;
|
||||
|
||||
UPROPERTY()
|
||||
bool bDisableShopDialMove = false;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
|
||||
virtual void CameraLeftMover();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user