How do I sync variables across the network when new players join?
Options
Hi,
I am trying to sync some variables to a new player when they join, but I don't know how I would do that. In UNET I could just put a [SyncVar] above the variable name, but I don't know how to do that here. I am still confused about how RPCs work.
Can someone please help me with this?
Thanks
I am trying to sync some variables to a new player when they join, but I don't know how I would do that. In UNET I could just put a [SyncVar] above the variable name, but I don't know how to do that here. I am still confused about how RPCs work.
Can someone please help me with this?
Thanks
0
Comments
-
Hi,
For variable synchronization use OnPhotonSerializeView or RPC's with PhotonTargets.AllBuffered option or room/player custom properties.
RPC described in details: https://doc.photonengine.com/en/pun/current/tutorials/rpcsandraiseevent1 -
All of these links have 404 pages... I'll see if I can find it through the url though.
https://doc.photonengine.com/en-us/pun/current/manuals-and-demos/rpcsandraiseevent0