Hi i'm developing a multiplayer game with Photon server.
The problem is i'm sucessfully instantiating my own character controller and its collider and the other players' as well. But when i run more than one instance of the project i cant see the other prefabs which i also instantiated. I can hit the collider but cant see the prefab. Every player can only see his own avatar but they can hit their colliders one another. Code is like this:
void SpawnMyPlayer(){
GameObject cube = GameObject.Find("Spawn");
//this is my avatar prefab.
GameObject MyPlayerGO = (GameObject)PhotonNetwork.Instantiate ("newAvatar", cube.transform.position, cube.transform.rotation, 0);
//this is avatar's position
Vector3 prefabPos = new Vector3 (MyPlayerGO.transform.position.x, 0.8f, MyPlayerGO.transform.position.z);
MyNameDisplay = (GameObject)PhotonNetwork.Instantiate ("nameDisplay", cube.transform.position, cube.transform.rotation, 0);
//Avatar prefab which i can not see from other instance.
MyAvatar = (GameObject)PhotonNetwork.Instantiate (avatarPrefab, prefabPos, cube.transform.rotation, 0);
MyAvatar.transform.parent = MyPlayerGO.transform;
MyNameDisplay.transform.parent = MyPlayerGO.transform;
MyNameDisplay.guiText.text = avatarName;
standbyCamera.enabled = false;
((MonoBehaviour) MyPlayerGO.GetComponent ("FPSInputController")).enabled = true;
MyPlayerGO.transform.FindChild ("characterCamera").gameObject.SetActive (true);
}
What am i doing wrong? Network doesnt seem to send every avatar prefab to all instances.
Thanks.