I am new to c++ and I can not find a way to move my pawn. I have been following this tutorial (but made it for ue5). But I can’t get the movement to work (only LookUp)
I am trying to move a pawn with inputs.
EDIT: I meant that I can LookUp but not move around.
In .cpp file:
void AVehiclePawn::SetupPlayerInputComponent(UInputComponent* CarInputComponent)
{
Super::SetupPlayerInputComponent(CarInputComponent);
CarInputComponent->BindAxis("Throttle", this, &AVehiclePawn::ApplyThrottle);
CarInputComponent->BindAxis("LookUp", this, &AVehiclePawn::LookUp);
}
//This is not working
void AVehiclePawn::ApplyThrottle(float Val)
{
GetVehicleMovementComponent()->SetThrottleInput(Val);
}
//This one is working
void AVehiclePawn::LookUp(float Val)
{
if (Val != 0.f)
{
AddControllerPitchInput(Val);
}
}
In .h file:
void ApplyThrottle(float Val);
void LookUp(float Val);
What have I done wrong?
Is there any tutorial that shows how I can set up the Chaos Vehicle in c++?