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 "Components/Button.h"
|
||||||
#include "GameFramework/Character.h"
|
#include "GameFramework/Character.h"
|
||||||
#include "Components/WidgetComponent.h"
|
#include "Components/WidgetComponent.h"
|
||||||
|
#include "Evaluation/MovieSceneCameraAnimTemplate.h"
|
||||||
|
#include "Kismet/KismetMathLibrary.h"
|
||||||
|
|
||||||
|
|
||||||
// Sets default values
|
// Sets default values
|
||||||
@ -34,6 +35,7 @@ void AInteraction::Tick(float DeltaTime)
|
|||||||
|
|
||||||
void AInteraction::OnInteract()
|
void AInteraction::OnInteract()
|
||||||
{
|
{
|
||||||
|
bDisableShopDialMove = true;
|
||||||
ShopDialogWidget = CreateWidget<UUserWidget>(GetWorld(), ShopDialog);
|
ShopDialogWidget = CreateWidget<UUserWidget>(GetWorld(), ShopDialog);
|
||||||
if (ShopDialogWidget == nullptr)
|
if (ShopDialogWidget == nullptr)
|
||||||
{
|
{
|
||||||
@ -96,7 +98,11 @@ void AInteraction::CameraLeftMover()
|
|||||||
}
|
}
|
||||||
else
|
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
|
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()
|
UPROPERTY()
|
||||||
bool bisDisabled = false;
|
bool bisDisabled = false;
|
||||||
|
|
||||||
|
UPROPERTY()
|
||||||
|
bool bDisableShopDialMove = false;
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
|
UFUNCTION(BlueprintCallable, Category= "ButtonLeft")
|
||||||
virtual void CameraLeftMover();
|
virtual void CameraLeftMover();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user