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

Edit a spawn gameobject

$
0
0
Scenario:
The master client spawn a texture on the scene.
The non-master client edit it.
Problem:
I see the texture changed only on the non-master client. How to send changes in a way that it´s synchronized?
On master client:
void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
if (stream.isWriting)
{
// nothing to write
}
else
{
rawData = (byte[])stream.ReceiveNext();
tex.LoadImage(rawData);
rawImage.material.mainTexture = tex;
}
}

Viewing all articles
Browse latest Browse all 8947

Trending Articles



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