Multiplayer - all players respond to same input

I am working on making my game multiplayer, and I have the server working, I can connect with clients, and everything works fine, except for one thing…

All of the players are responding to input. I can start a server, connect with two clients, and the player units from both clients will move in unison to input from either client.

I’m pretty sure this is a common problem to people learning networking; anyone know what I’m doing, without me having to post a huge chunk of networking code?

ofc it is the common issue with everyone who starts learning networking...

all you have to do is add this condition where you check for input.

if(networkView.isMine)

For example:

function update()
{

if(networkView.isMine)
{

    // handle input here!!!
}

}

or you can do it the other way also

function Start()

{

  if(!networkView.isMine)
  {
     enabled=false;
  }
}

If you are passing the moving controls through the server side, make sure you send the return message to the sender and not to all. This will be your bible when learning networking in Unity.