diff --git a/Content/Blueprints/BP_MyTempCharacter.uasset b/Content/Blueprints/BP_MyTempCharacter.uasset index 56f24b2..5c87a2d 100644 --- a/Content/Blueprints/BP_MyTempCharacter.uasset +++ b/Content/Blueprints/BP_MyTempCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e80b44e582d11e6ad42033c0a1a16231f6301999bae071ebfb5b4e873f21d127 -size 22069 +oid sha256:ac2b6ffc86b65fe30fcc0358b8b0242d0b1aa0a2bf21b45f1c2030edc1383f4b +size 25526 diff --git a/Content/Levels/MerchantPrototype.umap b/Content/Levels/MerchantPrototype.umap index 2aae519..742f1a6 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:8754e6b425965184b0956fcfe7ebd1699d6733f6f44a1351ad6b9a44896afea0 +oid sha256:f8ddf56cb9911f76fc53b56bce7f4d9b975536954fcca5b0645c7617b07deaed size 23754 diff --git a/Source/the_twilight_abyss/MerchantRaw/MerchantTriggerBox.cpp b/Source/the_twilight_abyss/MerchantRaw/MerchantTriggerBox.cpp index b519e46..79ebc12 100644 --- a/Source/the_twilight_abyss/MerchantRaw/MerchantTriggerBox.cpp +++ b/Source/the_twilight_abyss/MerchantRaw/MerchantTriggerBox.cpp @@ -3,6 +3,8 @@ #include "MerchantTriggerBox.h" +#include "the_twilight_abyss/PlayerTemp/TempCharacter.h" + //makes it so the component script is initialized when game starts UMerchantTriggerBox::UMerchantTriggerBox() { @@ -17,6 +19,7 @@ void UMerchantTriggerBox::BeginPlay() UE_LOG(LogTemp, Warning, TEXT("TRIGGER SPAWNED")); } + void UMerchantTriggerBox::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); @@ -24,16 +27,6 @@ void UMerchantTriggerBox::TickComponent(float DeltaTime, ELevelTick TickType, FA } -void UMerchantTriggerBox::PlayerCheck() -{ - /* - TODO: - UNCOMMENT THE UPRIMITECOMPONENT OUT - FILL OUT THE COMPONENTOVERLAP FUNCTION SO IT DISPLAYS THE PLAYERS NAME WHEN THEY ENTER IT - */ - - //UPrimitiveComponent TriggerOverlap = BeginComponentOverlap(); -} diff --git a/Source/the_twilight_abyss/MerchantRaw/MerchantTriggerBox.h b/Source/the_twilight_abyss/MerchantRaw/MerchantTriggerBox.h index a68076c..980a86e 100644 --- a/Source/the_twilight_abyss/MerchantRaw/MerchantTriggerBox.h +++ b/Source/the_twilight_abyss/MerchantRaw/MerchantTriggerBox.h @@ -20,8 +20,4 @@ protected: public: UMerchantTriggerBox(); virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; - -private: - void PlayerCheck(); - }; diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp index af85bd7..a4f34e8 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.cpp @@ -4,9 +4,10 @@ #include "TempCharacter.h" #include "../../../Plugins/Developer/RiderLink/Source/RD/thirdparty/clsocket/src/ActiveSocket.h" +#include "Components/SphereComponent.h" -// Sets default values +// CONSTRUCTOR ATempCharacter::ATempCharacter() { // Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it. @@ -20,17 +21,20 @@ void ATempCharacter::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 void ATempCharacter::RightMoveInput(float Axis) { AddMovementInput(GetActorRightVector()* Axis); } + // Called every frame void ATempCharacter::Tick(float DeltaTime) { @@ -45,7 +49,7 @@ void ATempCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputCompo PlayerInputComponent->BindAxis(TEXT("Move Right / Left"), this, &ATempCharacter::RightMoveInput); PlayerInputComponent->BindAxis(TEXT("Turn Right / Left Mouse"), this, &ATempCharacter::AddControllerYawInput); PlayerInputComponent->BindAxis(TEXT("Look Up / Down Mouse"), this, &ATempCharacter::AddControllerPitchInput); - PlayerInputComponent->BindAction("Interact", IE_Pressed, this, &ATempCharacter::KeyPressed); + PlayerInputComponent->BindAction("Interact", IE_Pressed, this, &ATempCharacter::KeyPressed); // custom keybind Interact } /* diff --git a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h index 0c0a54f..37d11a6 100644 --- a/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h +++ b/Source/the_twilight_abyss/PlayerTemp/TempCharacter.h @@ -3,6 +3,7 @@ #pragma once #include "CoreMinimal.h" +#include "Components/BoxComponent.h" #include "GameFramework/Character.h" #include "TempCharacter.generated.h" @@ -28,6 +29,7 @@ public: // Called to bind functionality to input virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; + void KeyPressed(FKey Interact); };