The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our

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.

Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Syncing Timer

2020-10-10 21:15:03

Hello I've been having an issue for a while now that pops up once in a while and was wondering if anyone has faced this issue or if there is a better way of approaching this with photon?

So the way our time synchronization works is once there is 2 players in the room the masterclient sends a rpc with the UnixTimestamp for when the game should start, with the RpcTarget set as AllBuffered/AllBufferedViaServer (both don't fix the problem). Then the client adds the unixtimestamp to the local DateTime variable therefore everyone should technically have the same timer regardless of whether someone joins in 5 seconds later.
However for some reason we are testing with 3 players and there is always at least 1 player who is 5 seconds behind and the other two are a few seconds apart.

Here is our code:


2020-10-13 09:14:11

Can't you simply using Photon's provided timestamps for RPCs? You could even save a time stamp from an RPC, particularly the one that starts the game. Check here.

2021-06-18 16:17:09

any update on this? the documentation is not so clear and I'm unable to solve this problem.

Back to top