why it doesn't work? ;)

hi,
i need help after one long day of brainstorming!

1 server 2 client.

onServerInitialized => network.instantiate(cube);
onPlayerConnected : sendRPC only to him to execute the network.instantiate(cube)

Cube : prefab with networkview on Unreliable, observing the script attached containing this :

void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info){

      if(stream.isWriting) { //so, if i am the owner, i send my position and other things : y, actualweapon, life,..
                _x = myLocalPlayerPrefab.transform.position.x 
                 stream.Serialize(ref _x);  

      } else { //if i am not the owner, place the cube where the other player tell me he is  (the cube will be after another player model)
                 stream.Serialize(ref _x);
                 transform.position.x = _x;  //place the cube where the other player supposed to be.
      }

}

with 2 players (the server and the client), there is no problem!

but when an other player connect, there are 3 cube but it’s like 2 cube have the same position.

someone understood what i said? :slight_smile:
thank you!!

Wonderful, it works but i don’t know why…

In effect, it seems that’s when the 3th client connect, the server use iswriting for this new cube and not reading even if it’s not the owner.

my problem was solved using if(stream.isWriting networkviewOfThePrefabSetInThisPropertyInTheInspector.isMine)

if someone have a better solution, tell me. thanks