But when the player A(networkplayer 1) use the function theGameObject.GetComponent(NetworkView).owner, it returns 0 and not 2. But nobody else can say anything on the channel as nobody would listen to him at all. I have a gameObject with a NetworkView: This gameObject is instantiated by another player B(networkplayer 2) with Network.Instantiate() For the player B theGameObject.GetComponent(NetworkView).owner 2, So it's correct. So basically the observer 'says' something and anybody interested in it listens to it. I would have to check if PUN does that but I would take it for granted that it does.įor that reason it technically shouldn't be possible to write from anyone but the owner cause the owner system normally, in any other place, is meant to be an 'Observer pattern' if that tells you something. Only RPCs can be sent in both directions as functions are called there explicitely at a remote place which ensures that nothing can fuck up, there is no 'delta code' etc as they are to send parameters to a remote place for remote function execution thats meant to handle its own transactional correctness There is also a reason for doing that and thats if anybody can write, how do you resolve the situation where 2 write at the same time? With delta its not possible to resolve that at all anymore, you get an undefined state and thats about the very last thing you want to see happen. If it does what one would intuitively assume, work like Unity networking, then yes, it would limit the write to only the owner. I've gotten my program to work successfully over the network when using Unity's normal NetworkView setup, but am unable to do it now with the PhotonView implementation.Īnyone have an idea what the problem might be? Thanks in advance. Again, I am able to successfully call RPC's, and am sure my program is able to communicate with the master server and basically that my server side setup is correct. I've setup a Debug.Log() statement as my first statement within this function, and noticed that it is never outputed in Unity and basically that the OnPhotonSerializeNetwork() function is never called in my program. Within my Controller script, I've implemented the OnPhotonSerializeNetwork() function. I set the "ObserveOption" property to ReliableDataCompressed. I have attached a PhotonView object to my prefab, and dragged my Controller script which derives from Photon.MonoBehavior into the "Observe" property of the PhotonView object. I have also gotten the demo unity project included in the plugin to work. I have verified that RPC's work in my program, and have verified that the overall server/client setup is working. I'm having trouble getting my PhotonView setup to work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |