Problem MultiPlayer - Player can't move and stucks in the choosing team section..

You see i have made my multiplayer scripts and all,added to all movement scripts the networkView.isMine but still it happens.I have also did the “Run in background” but still.

Here are my scripts:
Multiplayer.js

 #pragma strict

var remoteIpaddress = "127.0.0.1";
var remotePort = 25000; 
var listenPort = 25000;

var playerCount : int = 0;

var useNat = true;

var myIP = "";
var myPort = "";

var MaxPlayers = 10;


function OnConnectedToServer ()
{
    
}

function OnDisconnectedFromServer ()
{
    
}

function OnGUI ()
{
   if(Network.peerType == NetworkPeerType.Disconnected)
   {
       if(GUI.Button(Rect(5,5,120,30),"Connect"))
       {
           useNat = true;
           Network.Connect(remoteIpaddress, remotePort);
       }
       if(GUI.Button(Rect(5, 40, 120,30),"Start Server"))
       {
           useNat = true;
           Network.InitializeServer(MaxPlayers,listenPort,useNat);
       }
       
       remoteIpaddress = GUI.TextField(Rect(5, 75, 120, 30),remoteIpaddress);
       remotePort = parseInt(GUI.TextField(Rect(5, 110, 60, 30),remotePort.ToString()));
       
   }
  else
  {
       if(GUI.Button(Rect(5,5,60,30),"Disconnect"))
       {
           Network.Disconnect(200);
       }
  }
 }

My SpawnScript:

#pragma strict

#pragma strict

var PlayerA : GameObject;
var PlayerB : GameObject;

var dead : boolean = false;
var health : int = 100;

var CurTeam : String = "";

var Connection : boolean = true;

var SpawnPointA : GameObject;
var SpawnPointB : GameObject;

var CenterW : float;
var CenterH : float;

function Start () {
	
	
	
	CurTeam = "";
	CenterW = Screen.width / 2 - 150;
	CenterH = Screen.height / 2 - 80;
}

function Update () {
	
}

function OnGUI()
{
if(Network.peerType == NetworkPeerType.Disconnected)
{
	Connection=false;
}
else
{
	Debug.Log("Connected");
	Connection = true;
}

if(Connection == true)
{
	if(CurTeam== ""){
	GUI.Box(Rect(CenterW, CenterH, 300, 160),"Select a Team");
	if(CurTeam == "")
	{
		if(GUI.Button(Rect(CenterW + 5,CenterH + 20, 290, 65),"A"))
		{
			Network.Instantiate(PlayerA, SpawnPointA.transform.position, transform.rotation, 0);
			CurTeam = "A";
			dead=false;
		}	
		if(GUI.Button(Rect(CenterW + 5,CenterH + 90, 290, 65),"B"))
		{
			Network.Instantiate(PlayerB, SpawnPointB.transform.position, transform.rotation, 0);
			CurTeam = "B";
		}
	}
	else
	{
		if(dead==true)
		{
		if(GUI.Button(Rect(CenterW + 5,CenterH + 20, 290, 130),"Respawn") && dead == true)
		{
			if(CurTeam == "A")
			{
				Network.Instantiate(PlayerA, SpawnPointA.transform.position, transform.rotation, 0);
				dead=false;
			}
			if(CurTeam == "B")
			{
				Network.Instantiate(PlayerB, SpawnPointB.transform.position, transform.rotation, 0);
			}
		}
	}
}
	Die();
	
	
}
}
}
function Die()
{
	if(health==0)
	{
	dead = true;
	Network.Destroy(PlayerA);
	}
	else
		dead = false;	
}

Each player object has its own camera name / prefabs but still it stucks on the choose menu and i can’t control the character…HELP?

Anyone ? Please??

May I ask you why “useNat” is always true?
I assume you’re using “useNat” to connect to the server, am I correct?
What you basically say is “you’re already connected to the internet, click “connect” to connect to the internet or click “start server” to connect to the internet”.
And even when disconnecting, it never, ever, ever gets on false.

Besides, call the connection commands in the Update() function, not in the OnGUI() function.
It makes no sense this way.

Your second script is even more problematic. I’m surprised to see how empty “Update()” is.
Never call a function that’s supposed to be ran all the time (like “Die()”) in the OnGUI() function.
OnGUI() does not update for the most of the time.
Put “Die()” in the Update() function.
Don’t worry, you’ll only die when your health is at 0.
And while we’re at it, put the following in the Update() function.

For example, if you want to make the connection check work, put the following in the Update() function:

void Update() {
    if(Network.peerType == NetworkPeerType.Disconnected) {
        Connection=false;
    }
    else {
        Debug.Log("Connected");
        Connection = true;
    }
}

Your initial health is 100 for as long as the game runs AND doesn’t save.
You should include the following to ensure your health always starts at 100 in every match:

void Start() {
    health = 100;
    dead = false;
}

Not doing that will result any player that already died will instantly die.
Or if you a player ended a match with 45 health, will start with 45 health in the next match.

Starting from line 66, you’re performing a rather useless check.
What I mean to say is:

if(dead==true)
{
   if(GUI.Button(Rect(CenterW + 5,CenterH + 20, 290, 130),"Respawn") && dead == true)
   {

You are checking if the player died, good.
But then you are performing the same check again.
Remove “&& dead == true” part from the second check.

A smaller yet important mistakes, you’re checking “if(CurTeam == “”)” twice in a row, completely unnecessary.
You should remove the second one.

Finally:

   if(dead==true)
   {
     if(CurTeam == "A")
     {
      Network.Instantiate(PlayerA, SpawnPointA.transform.position, transform.rotation, 0);
      dead=false;
     }
     if(CurTeam == "B")
     {
      Network.Instantiate(PlayerB, SpawnPointB.transform.position, transform.rotation, 0);
     }
   }

Put this in the Update() function, OnGUI can’t do anything with it at all.

And like it was not enough:

    Die();
}
}
}

What the hell do those mean?
Remove the last 2 ones, they will give errors while compiling.
I’m surprised Unity didn’t complain about that.