Problem Synchronizating Instantiated Object
I'm trying to create a game object inside a layout to show the players inside the room, instantiating the game object and setting the parent and scale. The Instantiated works well but I cannot modify the object of the other players, only is modified in my game.
The gameObject have attached a photonview and a photonviewtranform.
There is the code;
I'm stuck and I dont know what i'm missing, I will very appreciate a little help, thanks alot.
The gameObject have attached a photonview and a photonviewtranform.
There is the code;
public override void OnJoinedRoom() { Post = PhotonNetwork.Instantiate("PlayerPost", new Vector3(0, 0, 0), Quaternion.identity, 0); Post.transform.SetParent(Content.transform); Post.gameObject.transform.localScale = new Vector3(1, 1, 1); }
I'm stuck and I dont know what i'm missing, I will very appreciate a little help, thanks alot.
0
Comments
-
Ok, now I have two objects whit scripts, the first Instantiates the prefab OnJoinedRom and the second (the instantiated) sets the new transform.
First GameObjectpublic override void OnJoinedRoom() { PhotonNetwork.Instantiate("PlayerPost", new Vector3(0, 0, 0), Quaternion.identity, 0); }
Second GameObjecttransform.SetParent(GameObject.Find("Party List").GetComponent<Transform>()); transform.localScale = new Vector3(1, 1, 1);
Seems it works "correctly" , but im not sure why it can works whitout a PhotonTransformView.
Now I will try to find how change the data of one scrip attachet to the Instantiated Game object posted before in all players in the room.
I find these posts and I think is what I want, but I'm a little confused, so I will try to study it.
https://forum.photonengine.com/discussion/10281/how-can-i-reference-an-instantiated-scene-object
https://doc.photonengine.com/en-us/pun/current/gameplay/instantiation#custom_instantiation_data0 -
I have solved it by myself using a punrpc.0