Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void SpawnPlayer()
- {
- GameObject MyPlayerGO = PhotonNetwork.Instantiate("PlayerTwo", new Vector3(0f, 0f, 100f), Quaternion.identity, 0);
- MyPlayerGO.transform.Find("PlayerTwo/Camera").gameObject.SetActive(true);
- GetComponent<PhotonView>().RPC("SpawnPlayerRPC", PhotonTargets.AllBuffered, Player.MyPlayer.nick, MyPlayerGO.GetComponent<PhotonView>().viewID);
- }
- [PunRPC]
- public void SpawnPlayerRPC(string nick, int pvID, PhotonMessageInfo pmi)
- {
- GameObject NewPlayerGO = PhotonView.Find(pvID).gameObject;
- NewPlayerGO.name = "Gracz_" + nick;
- Player player = Player.FindPlayer(pmi.sender);
- player.gameObject = NewPlayerGO;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement