Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

Issues When Adding PhotonViews to GameObjects at Runtime

$
0
0
Hello! I am working on a game where I need to be able to add and remove PhotonViews to objects at runtime relatively frequently. I have a system where I add a PhotonView on the client side, then send the name of the GameObject, and the ViewID that I allocated to the PhotonView through a custom PhotonView (lets just call it SharedInfo) script that I have created. SharedInfo then sends the data over the network to itself (serializes it? I'm not sure what the technical term is for this). It uses the name that is sent over the network to find the corrosponding GameObject and creates a PhotonView on that object, with a ViewID that is the same as the one sent over the network. Sorry if I explained this poorly. Anyways, when the master client runs this, everything works fine. But the weird thing is that when a non-master client runs this, I get the following warning. Received OnSerialization for view ID XXXX. We have no such PhotonView! Ignored this if you're leaving a room. State: Joined What is weird is that the warning doesn't appear at all on the non-master clients. It only appears on the master client when a non-master client tries to run through this "process". What I also find strange is that it seems to be stopping SharedInfo from reading anything from the stream on the master client (as I found out by putting a debug.log in the start of if (stream.isreading), and seeing that the debug.log never showed up in the console). Again, I'm sorry if this is explained poorly. But does anybody have any ideas as to why this might be happening?

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>