Untitled
unknown
plain_text
15 days ago
787 B
2
Indexable
Never
#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); }
Leave a Comment