presidents-brigade/Source/PresidentsBrigade/PlayerPawn.cpp
Sara Montecino ac06935419 Add stuf
2022-11-06 16:27:33 -08:00

22 lines
871 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);
PlayerInputComponent->BindAction("Shoot", EInputEvent::IE_Pressed, this, &ABasePawn::shoot);
}