when i press play my tank does not move when i press w s d a, id ont know why
here is the code
#include “Tank.h”
#include “GameFramework/SpringArmComponent.h”
#include"Camera/CameraComponent.h"
#include “Components/InputComponent.h”
#include “Kismet/GameplayStatics.h”
#include “DrawDebugHelpers.h”
ATank::ATank()
{
SpringArm = CreateDefaultSubobject(TEXT(“SpringArm”));
SpringArm → SetupAttachment(RootComponent);
Camera = CreateDefaultSubobject(TEXT(“Camera”));
Camera → SetupAttachment(SpringArm);
}
void ATank::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent -> BindAxis(TEXT("MoveFoward"), this, &ATank::Move);
PlayerInputComponent -> BindAxis(TEXT("Turn"), this, &ATank::Turn);
}
void ATank::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
FHitResult HitResult;
if(PlayerControllerRef)
{
PlayerControllerRef -> GetHitResultUnderCursor(ECollisionChannel::ECC_Visibility, false, HitResult);
RotateTurret(HitResult.ImpactPoint);
}
}
void ATank::BeginPlay()
{
Super::BeginPlay();
PlayerControllerRef = Cast<APlayerController>(GetController());
}
void ATank::Move(float Value)
{
FVector DeltaLocation = FVector::ZeroVector;
DeltaLocation.X = Value * Speed * UGameplayStatics::GetWorldDeltaSeconds(this);
AddActorLocalOffset(DeltaLocation, true);
}
void ATank::Turn(float Value)
{
FRotator DeltaRotation = FRotator::ZeroRotator;
DeltaRotation.Yaw = Value*TurnRate* UGameplayStatics::GetWorldDeltaSeconds(this);
AddActorLocalRotation(DeltaRotation, true);
}



