// 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(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); }