# Why does my server not allow MaxWalkSpeed to change on client?

**URL:** <https://forums.unrealengine.com/t/why-does-my-server-not-allow-maxwalkspeed-to-change-on-client/759455>\
**Category:** Programming & Scripting\
**Tags:** Networking, Replication, Input, unreal-engine, CPP, question\
**Created:** [January 30, 2023, 5:03am UTC](https://forums.unrealengine.com/t/why-does-my-server-not-allow-maxwalkspeed-to-change-on-client/759455 "2023-01-30T05:03:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aejjee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aejjee/32/1204088_2.png) [@Aejjee](https://forums.unrealengine.com/u/Aejjee)\
**Post date:** [January 30, 2023, 5:03am UTC](https://forums.unrealengine.com/t/why-does-my-server-not-allow-maxwalkspeed-to-change-on-client/759455/1 "2023-01-30T05:03:29Z")

</div>

When I set the `MaxWalkSpeed` of the player character on the client when the character presses the sprint input action, the server does not let the character walk faster. Initially I had thought that the client simply wasn’t able to receive a sprint input action because the client character wasn’t sprinting when the action was pressed. What I believe is happening now is that the client is in fact trying to sprint but the server is moving the client back because it doesn’t agree that the `MaxWalkSpeed` has changed.

When I `showdebug enhancedinput` in the console I see the enhanced input box jitter back and forth only when I press the sprint button, which further implies that the client is moving faster but then is getting moved back by the server. My sprint input action looks like:

```auto
void APlayerCharacter::sprintInput(const FInputActionValue& value) {

	APlayerController* localPlayer = Cast<APlayerController>(GetController());

	GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::Yellow, FString::SanitizeFloat((float)GetRemoteRole()));

	
	if (value.Get<bool>()) {
		
		localPlayer->GetCharacter()->GetCharacterMovement()->MaxWalkSpeed *= 2.5f;
		//GetCharacterMovement()->MaxWalkSpeed *= 2.5f;
	}
	else {
		localPlayer->GetCharacter()->GetCharacterMovement()->MaxWalkSpeed /= 2.5f;

		//GetCharacterMovement()->MaxWalkSpeed /= 2.5f;
	}
	
	if (GetRemoteRole() == ROLE_Authority) {
		GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::Green, FString::SanitizeFloat(localPlayer->GetCharacter()->GetCharacterMovement()->MaxWalkSpeed));
		
	}
}

```

`bReplicates` is set to true, and all other aspects of the movement replicate correctly, but the server does not seem to receive when the `MaxWalkSpeed` of the client changes. Sprinting works fine on the server. How do I get the server to recognize the change to `MaxWalkSpeed`?

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [January 30, 2023, 10:44am UTC](https://forums.unrealengine.com/t/why-does-my-server-not-allow-maxwalkspeed-to-change-on-client/759455/2 "2023-01-30T10:44:44Z")

</div>

To have the server recognize the change to MaxWalkSpeed, you need to use a network replication method. In your code, you can use the `Multicast` or `Server` functions to replicate the MaxWalkSpeed changes from the client to the server. For example:

```auto
void APlayerCharacter::sprintInput(const FInputActionValue& value) {
  APlayerController* localPlayer = Cast<APlayerController>(GetController());
  
  if (value.Get<bool>()) {
    localPlayer->GetCharacter()->GetCharacterMovement()->MaxWalkSpeed *= 2.5f;
    MulticastSprintStart();
  }
  else {
    localPlayer->GetCharacter()->GetCharacterMovement()->MaxWalkSpeed /= 2.5f;
    MulticastSprintEnd();
  }
}

void APlayerCharacter::MulticastSprintStart_Implementation() {
  GetCharacterMovement()->MaxWalkSpeed *= 2.5f;
}

void APlayerCharacter::MulticastSprintEnd_Implementation() {
  GetCharacterMovement()->MaxWalkSpeed /= 2.5f;
}

```

This way, when the sprint input is pressed on the client, the `MulticastSprintStart` function will be called, which will replicate the change to MaxWalkSpeed to the server and all other clients in the network. Similarly, when the sprint input is released, the `MulticastSprintEnd` function will be called, replicating the change to MaxWalkSpeed back to the original value.

---

<div class="post-metadata">

**Author:** ![Aejjee](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/aejjee/32/1204088_2.png) [@Aejjee](https://forums.unrealengine.com/u/Aejjee)\
**Post date:** [January 30, 2023, 5:00pm UTC](https://forums.unrealengine.com/t/why-does-my-server-not-allow-maxwalkspeed-to-change-on-client/759455/3 "2023-01-30T17:00:13Z")

</div>

I tried to implement those changes but I am getting “Failed to link patch” errors. The errors are saying that those functions are already defined in my `PlayerCharacter.gen.cpp.obj`.

In the header file I am doing:

```auto
UFUNCTION(Server, Reliable)
    void MulticastSprintStart_Implementation();

UFUNCTION(Server, Reliable)
    void MulticastSprintEnd_Implementation();

```

And in my cpp file I’m doing:

```auto
void APlayerCharacter::MulticastSprintStart_Implementation() {
	GetCharacterMovement()->MaxWalkSpeed *= 2.5f;
}

void APlayerCharacter::MulticastSprintEnd_Implementation() {
	GetCharacterMovement()->MaxWalkSpeed /= 2.5f;
}

```

The errors I am getting when compiling live coding say:

 ![Screenshot 2023-01-30 095924](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/b/0/5b0c3362467bb917c388db100493f7c1943b5741.png)

---

<div class="post-metadata">

**Author:** ![ACE\_NANO](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ace_nano/32/1084232_2.png) [@ACE\_NANO](https://forums.unrealengine.com/u/ACE_NANO)\
**Post date:** [July 9, 2025, 1:24pm UTC](https://forums.unrealengine.com/t/why-does-my-server-not-allow-maxwalkspeed-to-change-on-client/759455/4 "2025-07-09T13:24:19Z")

</div>

Old post but these pop up on google so just in case someone comes across this post

You are not supposed to put “\_implementation” onto a the UFUNCTION declaration in the header file. When you declare a function as running on server; unreal engine will expect to see “\_implementation” tacked on to the end of the function in the cpp file.

.h file

```auto
UFUNCTION(Server, Reliable)
    void MulticastSprintStart();

UFUNCTION(Server, Reliable)
    void MulticastSprintEnd();

```

.cpp file

```auto
void APlayerCharacter::MulticastSprintStart_Implementation() {
	GetCharacterMovement()->MaxWalkSpeed *= 2.5f;
}

void APlayerCharacter::MulticastSprintEnd_Implementation() {
	GetCharacterMovement()->MaxWalkSpeed /= 2.5f;
}

```

Also Specifically Aejjee’s problem is also probably due to either live coding or messed up compile files, which is resolved by deleting the Binaries, Intermediate, Saved, and DerivedDataCache folders and recompiling.
