Cleaned up scripts

This commit is contained in:
MH261677 2022-11-10 12:57:31 +00:00
parent 38ab588226
commit ba713ddb2e
6 changed files with 14 additions and 19 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:e80b44e582d11e6ad42033c0a1a16231f6301999bae071ebfb5b4e873f21d127 oid sha256:ac2b6ffc86b65fe30fcc0358b8b0242d0b1aa0a2bf21b45f1c2030edc1383f4b
size 22069 size 25526

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:8754e6b425965184b0956fcfe7ebd1699d6733f6f44a1351ad6b9a44896afea0 oid sha256:f8ddf56cb9911f76fc53b56bce7f4d9b975536954fcca5b0645c7617b07deaed
size 23754 size 23754

View File

@ -3,6 +3,8 @@
#include "MerchantTriggerBox.h" #include "MerchantTriggerBox.h"
#include "the_twilight_abyss/PlayerTemp/TempCharacter.h"
//makes it so the component script is initialized when game starts //makes it so the component script is initialized when game starts
UMerchantTriggerBox::UMerchantTriggerBox() UMerchantTriggerBox::UMerchantTriggerBox()
{ {
@ -17,6 +19,7 @@ void UMerchantTriggerBox::BeginPlay()
UE_LOG(LogTemp, Warning, TEXT("TRIGGER SPAWNED")); UE_LOG(LogTemp, Warning, TEXT("TRIGGER SPAWNED"));
} }
void UMerchantTriggerBox::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) void UMerchantTriggerBox::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{ {
Super::TickComponent(DeltaTime, TickType, 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();
}

View File

@ -20,8 +20,4 @@ protected:
public: public:
UMerchantTriggerBox(); UMerchantTriggerBox();
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
private:
void PlayerCheck();
}; };

View File

@ -4,9 +4,10 @@
#include "TempCharacter.h" #include "TempCharacter.h"
#include "../../../Plugins/Developer/RiderLink/Source/RD/thirdparty/clsocket/src/ActiveSocket.h" #include "../../../Plugins/Developer/RiderLink/Source/RD/thirdparty/clsocket/src/ActiveSocket.h"
#include "Components/SphereComponent.h"
// Sets default values // CONSTRUCTOR
ATempCharacter::ATempCharacter() ATempCharacter::ATempCharacter()
{ {
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it. // 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) void ATempCharacter::ForwardInput(float Axis)
{ {
AddMovementInput(GetActorForwardVector()* Axis); AddMovementInput(GetActorForwardVector()* Axis);
} }
//Binds the input we made in the setup player component to the right vector
void ATempCharacter::RightMoveInput(float Axis) void ATempCharacter::RightMoveInput(float Axis)
{ {
AddMovementInput(GetActorRightVector()* Axis); AddMovementInput(GetActorRightVector()* Axis);
} }
// Called every frame // Called every frame
void ATempCharacter::Tick(float DeltaTime) 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("Move Right / Left"), this, &ATempCharacter::RightMoveInput);
PlayerInputComponent->BindAxis(TEXT("Turn Right / Left Mouse"), this, &ATempCharacter::AddControllerYawInput); PlayerInputComponent->BindAxis(TEXT("Turn Right / Left Mouse"), this, &ATempCharacter::AddControllerYawInput);
PlayerInputComponent->BindAxis(TEXT("Look Up / Down Mouse"), this, &ATempCharacter::AddControllerPitchInput); 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
} }
/* /*

View File

@ -3,6 +3,7 @@
#pragma once #pragma once
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "Components/BoxComponent.h"
#include "GameFramework/Character.h" #include "GameFramework/Character.h"
#include "TempCharacter.generated.h" #include "TempCharacter.generated.h"
@ -28,6 +29,7 @@ public:
// Called to bind functionality to input // Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
void KeyPressed(FKey Interact); void KeyPressed(FKey Interact);
}; };