How to synchronize time of day across multiple clients in a multiplayer game?

Modified on Fri, 30 Apr 2021 at 12:34 PM

In Voxel Play, time can advance automatically on every client based on the World Definition settings. For example, if you have "Day Cycle Speed" different from zero, time will progress at certain speed:


       

Every machine will have this behaviour, however the start time will be different based on the moment the game was started on every machine.


To synchronize the time across all clients, you can send a message to every client every certain interval (ie. every 15 or 30 seconds) with the current rotation of the Sun (usually the Directional Light in the scene) and use the API SetSunRotation on the client to update the current Sun rotation.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article