presidents-brigade/Source/PresidentsBrigade/PlayerPawn.cpp
Sara Montecino 74a0f0b906 Refactor
2022-11-05 13:50:04 -07:00

21 lines
776 B
C++
Executable File

// Fill out your copyright notice in the Description page of Project Settings.
#include "PlayerPawn.h"
#include "Camera/CameraComponent.h"
APlayerPawn::APlayerPawn(const FObjectInitializer &object_initializer):
ABasePawn(object_initializer)
{
main_camera = object_initializer.CreateDefaultSubobject<UCameraComponent>(this, FName("MainCamera"));
main_camera->SetupAttachment(root_component);
}
// Called to bind functionality to input
void APlayerPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAxis("MoveForward", this, &ABasePawn::handle_move_forward);
PlayerInputComponent->BindAxis("MoveRight", this, &ABasePawn::handle_move_right);
}