Client input values not being passed along

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.

Input can’t run on the server. This is not how it works. The input is collected on the client and then the values would be replicated, most likely via an RPC or replicated member variable to the server.

This course isn’t really designed to work on UE5 - the title is Unreal 4 Multiplayer so I would recommend getting this working with legacy input which works perfectly well and sticking with that. Fighting with Input differences is not ideal and detract from the learning experience.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms