I am experiencing an issue where I am trying to follow this course but am using the enhanced input system from UE 5.x
My input binding is as follows:
Super::SetupPlayerInputComponent(PlayerInputComponent); //Call the parent version
// Get the player controller
auto playerController = Cast<APlayerController>(GetController());
// Get the local player enhanced input subsystem
auto eiSubsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(playerController->GetLocalPlayer());
//Add the input mapping context
eiSubsystem->AddMappingContext(inputMapping, 0);
// Get the EnhancedInputComponent
auto playerEIcomponent = Cast<UEnhancedInputComponent>(PlayerInputComponent);
//Bind Move() to the mapping
playerEIcomponent->BindAction(inputMoveForward, ETriggerEvent::Triggered, this, &APlayerTank::Server_Move);
playerEIcomponent->BindAction(inputMoveForward, ETriggerEvent::Completed, this, &APlayerTank::Server_StopMovement);
playerEIcomponent->BindAction(inputTurn, ETriggerEvent::Triggered, this, &APlayerTank::Server_TurnTank);
playerEIcomponent->BindAction(inputTurn, ETriggerEvent::Completed, this, &APlayerTank::Server_StopTurnTank);
}
I have a debug on screen printing:
void APlayerTank::Server_Move_Implementation(const FInputActionValue& Value) {
if ((GEngine))
{
GEngine->AddOnScreenDebugMessage(-1, 0.5f, FColor::Emerald, FString::Printf(TEXT("SMI : %f"), Value.Get<float>()));
}
Throttle = Value.Get<float>();
}
Now when the server drives around there is no issue.
If the client drives around the value that is being passed through is 0.0000 f So the throttle doesn’t do anything.
I presume the issue lies with the binding of the controls but I do not see what i need to change.