How to sync variables across clients?
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
How to sync variables across clients?
okMajd
2022-02-21 14:55:54
Hello, I have a group of gameobjects (30+) which all have variables that are randomized on start. I need to sync these across the client to make sure they have the same material, variables, etc as it is necessary for gameplay. How would I do this? I don't think I can use RPC because I would need to do that for every variable manually and keep a list of every object at all times. Thanks
Comments
Hello i'm using RaiseEvent with CacheOption = AddToRoomCache for saving value for users who will join later then event
Read about Synchronization and State. And or read about sharing a seed value, then using the pseudo-random number generator to generate many values from this.
Cached events are not the best approach.
Back to top