PhotonNetwork.Time = 0

develax
develax ✭✭
From time to time in the first two OnPhotonSerializeView method calls PhotonNetwork.Time is 0. In the beginning, I couldn't understand the occasional strange behaviour of the remote player until I could detect it in the debugging process.. Very rarely but still it happens that PhotonNetwork.Time continues to be 0 for a long time. What could be the reason for this and how to handle it?

Comments

  • develax
    develax ✭✭
    edited July 2019
    Isn't anyone interested?
    It would be great if it was documented. At the moment it's said that

    Photon network time, synched with the server.
    ...
    It can start with any positive value.


    As I understand it, it shouldn't be available until it's synced and it can't be 0.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @develax,

    The value of PhotonNetwork.Time is 0 when it's not available (fetched from the server) yet.
    The value is per server so when you are switching servers, like when joining a room or leaving one, it can be 0 temporarily but it should not be a long time.
  • Hi @JohnTube,
    thank you for the clarification!
    I assumed that this was so but still wanted to be sure.
    Since received data is mostly useless when PhotonNetwork.Time == 0 (it can't be used for interpolation) I just teleport the object at its current position in this case and then drop this packet out of the buffer.