55 lines
1.6 KiB
C++
55 lines
1.6 KiB
C++
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||
|
|
||
|
|
||
|
#include "TempCharacter.h"
|
||
|
|
||
|
#include "../../../Plugins/Developer/RiderLink/Source/RD/thirdparty/clsocket/src/ActiveSocket.h"
|
||
|
|
||
|
|
||
|
// Sets default values
|
||
|
ATempCharacter::ATempCharacter()
|
||
|
{
|
||
|
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
|
||
|
PrimaryActorTick.bCanEverTick = true;
|
||
|
}
|
||
|
|
||
|
// Called when the game starts or when spawned
|
||
|
void ATempCharacter::BeginPlay()
|
||
|
{
|
||
|
Super::BeginPlay();
|
||
|
|
||
|
}
|
||
|
|
||
|
void ATempCharacter::ForwardInput(float Axis)
|
||
|
{
|
||
|
AddMovementInput(GetActorForwardVector()* Axis);
|
||
|
|
||
|
}
|
||
|
|
||
|
void ATempCharacter::RightMoveInput(float Axis)
|
||
|
{
|
||
|
AddMovementInput(GetActorRightVector()* Axis);
|
||
|
}
|
||
|
|
||
|
// Called every frame
|
||
|
void ATempCharacter::Tick(float DeltaTime)
|
||
|
{
|
||
|
Super::Tick(DeltaTime);
|
||
|
}
|
||
|
|
||
|
// Called to bind functionality to input
|
||
|
void ATempCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||
|
{
|
||
|
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
||
|
PlayerInputComponent->BindAxis(TEXT("Move Forward / Backward"), this, &ATempCharacter::ForwardInput);
|
||
|
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);
|
||
|
}
|
||
|
|
||
|
void ATempCharacter::KeyPressed(FKey Interact)
|
||
|
{
|
||
|
UE_LOG(LogTemp, Display, TEXT("Interact key is being pressed"));
|
||
|
}
|