Untitled
unknown
plain_text
a year ago
787 B
9
Indexable
#include "MyCharacter.h"
AMyCharacter::AMyCharacter()
{
PrimaryActorTick.bCanEverTick = true;
}
void AMyCharacter::BeginPlay()
{
Super::BeginPlay();
}
void AMyCharacter::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAxis("MoveForward", this, &AMyCharacter::MoveForward);
PlayerInputComponent->BindAxis("MoveRight", this, &AMyCharacter::MoveRight);
}
void AMyCharacter::MoveForward(float Value)
{
AddMovementInput(GetActorForwardVector(), Value);
}
void AMyCharacter::MoveRight(float Value)
{
AddMovementInput(GetActorRightVector(), Value);
}
Editor is loading...
Leave a Comment