UNET - Prevent Local Client to receive Server Command!

Hi everyone!

Hope someone can point me in the right direction.

My goal is, that the Client A locally moves and sends his end position to the Server. The Server should send the new position to every client, but Client A should ignore the Server function call.

The idea is to prevent lags for the local player, the position should be only synced on other clients.

So far i managed that Client A sends his movement to the server. Now how can I achieve the rest? (PLS no reference to use NetworkTransform)


If you a re not using NetworkTransform, I assume you use ClientRpc. You could simply use the isLocalPlayer Attribute of your PlayerScript in order to ignore the received RPC. So inside your PlayerScript (which should extend NetworkBehaviour) you would have something similar to this:

public void RpcAdjustPosition()

    //Update Position