# Make Client Pawn Replicate Server Pawn Movement Exactly

**URL:** <https://forums.unrealengine.com/t/make-client-pawn-replicate-server-pawn-movement-exactly/330012>\
**Category:** Multiplayer & Networking\
**Tags:** server-to-client, networking-replicat, unreal-engine, Scripting, question\
**Created:** [August 26, 2015, 6:27pm UTC](https://forums.unrealengine.com/t/make-client-pawn-replicate-server-pawn-movement-exactly/330012 "2015-08-26T18:27:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jasper\_Moore](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jasper\_Moore](https://forums.unrealengine.com/u/Jasper_Moore)\
**Post date:** [August 26, 2015, 6:27pm UTC](https://forums.unrealengine.com/t/make-client-pawn-replicate-server-pawn-movement-exactly/330012/1 "2015-08-26T18:27:36Z")

</div>

I have a custom camera setup that allows the user to rotate/orbit around a central point, and control zoom – very simple setup… After a week of research as well as lots of experimentation, I managed to get a simple LAN setup going. Host and client enter the same level, each controlling a different version of the same camera pawn. What I want is for the client pawn to mimic the host pawn’s movement and rotation 1:1. I do this for product displays where I can access UI elements and controls on my screen, and clients (as in customers) can view an identical picture minus the UI on another screen; a “beauty screen”, if you will.  
From what I’ve read, I need to use a UFUNCTION to send data from server to client, this is what I have so far. I’ll just include the rotation part, for simplicity’s sake.

MyCamera.h

```
UFUNCTION(Reliable, Client, WithValidation)
void Client_UpdatePosition(FRotator newRot);
virtual void Client_UpdatePosition_Implementation(FRotator newRot);
virtual bool Client_UpdatePosition_Validate(FRotator newRot);

```

MyCamera.cpp

```
Void MyCamera::Tick(float DeltaTime)
{
	If(Role = Role_Authority)
    {
		//Get Mouse Input, and turn it into positional information… This part works fine.
		//Take That information, and send it to client (NewRotation)
		Client_UpdatePosition(NewRotation);
    }	
}
bool ACamCube::Client_UpdatePosition_Validate(FRotator newRot)
{
	return true;
}
void ACamCube::Client_UpdatePosition_Implementation(FRotator newRot)
{
    SetActorRotation(newRot);
}

```

This isn’t working as expected. I’ve tried multiple variations swapping Client, Server and Roles but to no avail. Does anyone know how I can make this work?

---

<div class="post-metadata">

**Author:** ![Devero](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Devero](https://forums.unrealengine.com/u/Devero)\
**Post date:** [August 26, 2015, 6:35pm UTC](https://forums.unrealengine.com/t/make-client-pawn-replicate-server-pawn-movement-exactly/330012/2 "2015-08-26T18:35:07Z")

</div>

The first thing that pops out too me is the “virtual” missing from the declaration. This may mess up UHT.

Try:

```
UFUNCTION(Reliable, Client, WithValidation)
 virtual void Client_UpdatePosition(FRotator newRot);
 virtual void Client_UpdatePosition_Implementation(FRotator newRot);
 virtual bool Client_UpdatePosition_Validate(FRotator newRot);
```

---

<div class="post-metadata">

**Author:** ![Jasper\_Moore](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jasper\_Moore](https://forums.unrealengine.com/u/Jasper_Moore)\
**Post date:** [August 26, 2015, 6:51pm UTC](https://forums.unrealengine.com/t/make-client-pawn-replicate-server-pawn-movement-exactly/330012/3 "2015-08-26T18:51:06Z")

</div>

The documentation leaves “Virtual” out on that line as well:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

I tried your suggestion anyway, but it didn’t make a difference.

---

<div class="post-metadata">

**Author:** ![Jasper\_Moore](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jasper\_Moore](https://forums.unrealengine.com/u/Jasper_Moore)\
**Post date:** [August 26, 2015, 6:59pm UTC](https://forums.unrealengine.com/t/make-client-pawn-replicate-server-pawn-movement-exactly/330012/4 "2015-08-26T18:59:19Z")

</div>

Is it possible that I need to run the UFUNCTION from a seperate script? Right now, it is included with the camera code. Since both cameras are using their own instance of this code, could that be the problem, or is that how it should work?
