- Home /
Two Photon problems
Hello, I know I should type this on Photon forum, but get answer there takes sometimes a week.
I have two problems with photon network.
I have players (2D) and every player can set their avatar (sprite). How can properly serialize them. Now player when join the room call the rpc in start() "GetComponent< PhotonView >().RPC("ChangeSkinTo", PhotonTargets.AllBuffered, PlayerPrefs.GetString("SkinSet"));" But there is problem, because this RPC call everyone when join to room and the sprite always change when somebody join. When is before statement "if (GetComponent< PhotonView >().isMine)", the sprite won't change in other clients (Just in client who calls it). For imagine the rpc looks this:
[RPC] void ChangeSkinTo(string skinName) { GetComponent<SpriteRenderer>().sprite = Resources.Load<Sprite>("Avatars/" + skinName); }
How client, who didn't instantiate object can destroy it when touch it by trigger?
I'm very thankful for every answer