27 lines
729 B
C++
27 lines
729 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "Tank.h"
|
|
|
|
#include "Camera/CameraComponent.h"
|
|
#include "GameFramework/SpringArmComponent.h"
|
|
|
|
ATank::ATank()
|
|
{
|
|
SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
|
|
SpringArm->SetupAttachment(RootComponent);
|
|
|
|
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
|
|
Camera->SetupAttachment(SpringArm);
|
|
}
|
|
|
|
void ATank::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
|
{
|
|
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
|
PlayerInputComponent->BindAxis(TEXT("MoveForward"), this, &ATank::Move);
|
|
}
|
|
|
|
void ATank::Move(float Value)
|
|
{
|
|
UE_LOG(LogTemp, Warning, TEXT("Move: %f"), Value);
|
|
} |