look at this example. i am create player prefabs when all plater are ready for the game, but, i have trowble with this because server can see client player pref and his pref<, but client cant see server player pref
https://www.youtube.com/watch?v=vJ2ANke9vss&feature=youtu.be look at this example. i am create player prefabs when all plater are ready for the game, but, i have trowble with this because server can see client player pref and his pref<, but client cant see server player pref
Comment
can you switch rolls, client in the editor? I think the server prefab is not spawned on the client.
void OnJoinedRoom()
{
inRoomChat = true;
PhotonNetwork.playerName = ls.playerName;
//if (!PhotonNetwork.is$$anonymous$$asterClient)
//{
// photonView.RPC ("StartGame", PhotonTargets.All);
//}
print (PhotonNetwork.playerList.Length);
if (PhotonNetwork.playerList.Length == 2)
{
photonView.RPC ("StartGame", PhotonTargets.All);
}
}
[PunRPC]
public void StartGame()
{
Camera.main.farClipPlane = 1000; //$$anonymous$$ain menu set this to 0.4 for a nicer BG
//prepare instantiation data for the viking: Randomly diable the axe and/or shield
bool[] enabledRenderers = new bool[2];
enabledRenderers[0] = Random.Range(0,2)==0;//Axe
enabledRenderers[1] = Random.Range(0, 2) == 0; ;//Shield
object[] objs = new object[1]; // Put our bool data ыin an object array, to send
objs[0] = enabledRenderers;
Show$$anonymous$$essage ("Підключення до сервера...");
DontDestroyOnLoad(PhotonNetwork.Instantiate(playerPrefabName, transform.position, Quaternion.identity, 0, objs));
Application.LoadLevel (2);
//PhotonNetwork.Instantiate(playerPrefabName, transform.position, Quaternion.identity, 0, objs);
}
Your answer
Follow this Question
Related Questions
Network lobby manager tutorial +PUN? 0 Answers
Photon Network, synchronize a int over the network. 1 Answer
Rejoin in photon network? 2 Answers