Bugfix Merchant Unable to Interact

This commit is contained in:
Philip W 2023-04-28 01:40:49 +01:00
parent bc171eba80
commit 9199db00df
6 changed files with 9 additions and 9 deletions

Binary file not shown.

Binary file not shown.

BIN
Content/Levels/Build.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -143,10 +143,9 @@ void ATempCharacter::LineTraceLogic()
FVector Start = ThisCamera->GetComponentLocation(); FVector Start = ThisCamera->GetComponentLocation();
FVector End = Start + GlobalTrace * ThisCamera->GetForwardVector(); FVector End = Start + GlobalTrace * ThisCamera->GetForwardVector();
FCollisionQueryParams TraceParams; FCollisionQueryParams TraceParams;
TraceParams.AddIgnoredActor(this); TraceParams.AddIgnoredActor(this);
bHit = GetWorld()->LineTraceSingleByChannel(OutHit, Start, End, ECC_Visibility, TraceParams); bHit = GetWorld()->LineTraceSingleByChannel(OutHit, Start, End, ECC_Pawn, TraceParams);
if (bHit) if (bHit)
{ {
//we store the GetItem function from InventoryComponent into ItemArray variable //we store the GetItem function from InventoryComponent into ItemArray variable

View File

@ -53,7 +53,7 @@ public:
void KeyPressed(); void KeyPressed();
UPROPERTY(EditAnyWhere) UPROPERTY(EditAnyWhere)
float TraceDistance = 500; float TraceDistance = 200;
void InputDisabler(); void InputDisabler();
void LineTraceLogic(); void LineTraceLogic();

View File

@ -7,6 +7,7 @@
#include "TurnBaseCombatV2.h" #include "TurnBaseCombatV2.h"
#include "BehaviorTree/BlackboardComponent.h" #include "BehaviorTree/BlackboardComponent.h"
#include "Blueprint/UserWidget.h" #include "Blueprint/UserWidget.h"
#include "Camera/CameraComponent.h"
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
#include "Misc/OutputDeviceNull.h" #include "Misc/OutputDeviceNull.h"
@ -101,7 +102,7 @@ void UHoldToInitCombat::OnClickDown()
AActor* UHoldToInitCombat::LookingAtEnemy() const AActor* UHoldToInitCombat::LookingAtEnemy() const
{ {
FVector Start = GetOwner()->GetActorLocation(); FVector Start = Cast<UCameraComponent>(GetOwner()->FindComponentByClass<UCameraComponent>())->GetComponentLocation();
FVector End = GetOwner()->GetActorForwardVector() * 1000.0f + Start; FVector End = GetOwner()->GetActorForwardVector() * 1000.0f + Start;
FCollisionQueryParams CollisionParams; FCollisionQueryParams CollisionParams;
CollisionParams.AddIgnoredActor(GetOwner()); CollisionParams.AddIgnoredActor(GetOwner());