# AddMovementInput Not working on Server. Why?

**URL:** <https://forums.unrealengine.com/t/addmovementinput-not-working-on-server-why/478772>\
**Category:** Multiplayer & Networking\
**Tags:** Replication, Server, replicate, rpc, unreal-engine, pawn, question\
**Created:** [February 14, 2021, 5:25am UTC](https://forums.unrealengine.com/t/addmovementinput-not-working-on-server-why/478772 "2021-02-14T05:25:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b220333c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b220333c](https://forums.unrealengine.com/u/anonymous_user_b220333c)\
**Post date:** [February 14, 2021, 5:25am UTC](https://forums.unrealengine.com/t/addmovementinput-not-working-on-server-why/478772/1 "2021-02-14T05:25:55Z")

</div>

I am trying to make a Pawn that can be controlled by a player and have it’s movement replicated.

I don’t want to use Character pawn so please don’t suggest that.

I understand that Default Pawns don’t automatically handle replication like the character does and you need to handle the movement on the Server with RPCs.

In my DefaultPawn class I have overriden the MoveForward function and added a Server/Client check to the move forward function. When the Client calls MoveForward it is correctly recognizing that it is the client and calling the RPC on the server. The server then runs the MoveForward function, I have debugged the function and it is definitely being called on the Server with the correct values.

The weird thing is nothing happens on the Server or Client when the MoveForward function called on the Server even though it is definitely being called.

Why does AddMovementInput() work when called on the Client but do absolutely nothing when called on the Server?  
MoveForaward function and it’s RPCs:

```
void ADefPawnTest::MoveForward(float Val)
{
	if (GetNetMode() == ENetMode::NM_DedicatedServer)
	{
		FVector Dir = GetActorForwardVector();
		AddMovementInput(Dir, Val * 200);
	}
	else if(GetNetMode() == ENetMode::NM_ListenServer)
	{
		FVector Dir = GetActorForwardVector();
		AddMovementInput(Dir, Val * 200);
	}
	else if (GetNetMode() == ENetMode::NM_Client)
	{
		ServerMoveForward(Val);
	}
}

bool ADefPawnTest::ServerMoveForward_Validate(float Val)
{
	return true;
}

void ADefPawnTest::ServerMoveForward_Implementation(float Val)
{
	MoveForward(Val);
}

```

---

<div class="post-metadata">

**Author:** ![Kehel18](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kehel18](https://forums.unrealengine.com/u/Kehel18)\
**Post date:** [February 14, 2021, 5:13pm UTC](https://forums.unrealengine.com/t/addmovementinput-not-working-on-server-why/478772/2 "2021-02-14T17:13:42Z")

</div>

Hello! I think that the thing is like that: Controllers exist only on clients, so everything connected with them are supposed to be on Clients. As you can see AddMovementInput() is just adding some vector to ControlInputVector, which is not replicating.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b220333c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b220333c](https://forums.unrealengine.com/u/anonymous_user_b220333c)\
**Post date:** [July 11, 2021, 11:08am UTC](https://forums.unrealengine.com/t/addmovementinput-not-working-on-server-why/478772/3 "2021-07-11T11:08:15Z")

</div>

Controllers exist on client and server. You are thinking of the client’s controller not existing on other clients. If the controller did not exist on the server the server would not be debugging the function when it is called.

---

<div class="post-metadata">

**Author:** ![killer\_hard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@killer\_hard](https://forums.unrealengine.com/u/killer_hard)\
**Post date:** [March 1, 2025, 4:30pm UTC](https://forums.unrealengine.com/t/addmovementinput-not-working-on-server-why/478772/4 "2025-03-01T16:30:49Z")

</div>

I may be wrong, but as I understood  
if(Get Local Role() == ROLE\_AutonomousProxy)  
{  
if(ACharacter\* Character = Cast(GetPawn()))  
{  
Character-\>AddMovementInput(Character-\>GetActorForwardVector(), Value);  
Character-\>AddMovementInput(Character-\>GetActorRightVector(), Value);  
}  
} and the motion component takes over all the work. the position on the server will change

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [March 1, 2025, 8:43pm UTC](https://forums.unrealengine.com/t/addmovementinput-not-working-on-server-why/478772/5 "2025-03-01T20:43:56Z")

</div>

Apply movement to the client directly, then RPC the server to move.

You’ll eventually need to setup client-side prediction and server correction.
