diff --git a/Content/Levels/MerchantPrototype.umap b/Content/Levels/MerchantPrototype.umap index abef8df..caea42f 100644 --- a/Content/Levels/MerchantPrototype.umap +++ b/Content/Levels/MerchantPrototype.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:71972a686580a51b5e39734fdadcbead9cab44f70aa423b1c2e684eb5c64d855 -size 23271 +oid sha256:f4a37ec4a9d65f2b21c7e29d31fb9b9dd998e181aa264ca826aa1e6594da30ef +size 23329 diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index d3affc5..a2d2355 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -18,14 +18,12 @@ ATempCharacter::ATempCharacter() void ATempCharacter::BeginPlay() { Super::BeginPlay(); - } //Binds the input we made in the setup player component to the forward vector void ATempCharacter::ForwardInput(float Axis) { AddMovementInput(GetActorForwardVector()* Axis); - } //Binds the input we made in the setup player component to the right vector @@ -51,13 +49,6 @@ void ATempCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputCompo PlayerInputComponent->BindAxis(TEXT("Look Up / Down Mouse"), this, &ATempCharacter::AddControllerPitchInput); PlayerInputComponent->BindAction("Interact", IE_Pressed, this, &ATempCharacter::KeyPressed); // custom keybind Interact } - -/* - TODO: - Make custom bool for pressed interact in trigger - Make custom bool for when player enters the trigger its set to true - Make if statement if both flags are true then dilouge box pops up - */ void ATempCharacter::KeyPressed() { //vars for LineTraceSingleByChannel @@ -67,18 +58,19 @@ void ATempCharacter::KeyPressed() FVector End = Start + TraceDistance * GetActorForwardVector(); FCollisionQueryParams TraceParams; + TraceParams.AddIgnoredActor(this); bool bHit = GetWorld()->LineTraceSingleByChannel(Hit,Start,End,ECC_Visibility, TraceParams); if(bHit) { - - DrawDebugLine(GetWorld(),Start, End, FColor::Green, false, 1.0f); - UE_LOG(LogTemp, Display, TEXT("HIT: %s"), *Hit.GetActor()->GetName()); - } - else - { - UE_LOG(LogTemp, Display, TEXT("BHIT IS FALSE")); + if(Hit.GetActor()->ActorHasTag("MerchantTag")) + { + DrawDebugLine(GetWorld(),Start, End, FColor::Green, false, 1.0f); + UE_LOG(LogTemp, Display, TEXT("HIT: %s"), *Hit.GetActor()->GetName()); + } } + } + \ No newline at end of file diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h index f5df595..5545325 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h @@ -3,8 +3,6 @@ #pragma once #include "CoreMinimal.h" -#include "Engine/World.h" -#include "DrawDebugHelpers.h" #include "GameFramework/Character.h" #include "TempCharacter.generated.h"