No longer an issue
How do you Sync Avatars that aren't being controlled over the Photon Unity Network so that everyone over the network sees the same thing?
Hello everyone, regarding my question, I tried placing a photonView onto the characters that aren't being controlled and the photonView is observing the script that contains an OnPhotonSerializeView method. But, when I build my game and play it on two different screens, both screens still create two instances of the characters that aren't being controlled. I have no idea how to solve this issue at this point. Please help. Also, I can link code if necessary.
Hi,
what do you mean by 'both screens still create two instances of the characters that aren't being controlled'? Do you call PhotonNetwork.Instantiate(...) after joining a room? This would at least explain why there are two objects. What happens in your OnPhotonSerializeView function? Do you use it for updating positions? Can you confirm that this function is at least being called?
Since I'm not sure if I fully understand the problem, maybe some additional code snippets would be helpful.
Answer by XxSimBaaxX · Jun 13, 2017 at 10:47 AM
there is a component called NetworkTransform that you can put on the object you want to sync its transform.
Thanks for the suggestion @XxSimBaaxX but I tried this and this doesn't work because I am using the photon unity network system. The network transform component only works with Unity's regular networking system.
PUN has its own script called PhotonTransformView where you can set up Transform synchronization.
Thanks alot @ChristianSimon , you've helped me tremendously.