How to synchronize data over Network


I have a guessing game, for example.
One player picks a number and another tries to guess it.

But how can guessing player check if he guessed right? Number is stored inside an object as a property.

And an additional question: is there a way to synchronize objects (instances of classes) over the network?

Thank you.

You could do that with an RPC call. As soons as the player picks a number an RPC call is made with the number as paramenter so the other player knows what to guess. As soon as the player who tries to guess chose the answer another RPC called is made with the number or whatever of the answer so you can check if the answer is correct on the side where it is stored.

To synchronize custom script see this topic for exmaple to get started.