I'm trying to make countdown timer for adding my game match by using custom properties. But i'm stuck somewhere. Timer is working but it's not shows same time with another clients who join later. My script here:
public float Totaltime = 600;
void Update()
{
Totaltime -= Time.deltaTime;
StartCountDownTimer(Totaltime);
}
void StartCountDownTimer(float totalSeconds)
{
Hashtable ht = new Hashtable() { { "startTime", totalSeconds } };
PhotonNetwork.room.SetCustomProperties(ht);
float updatedSecond = (float)PhotonNetwork.room.CustomProperties["startTime"];
int minutes = Mathf.FloorToInt(updatedSecond / 60f);
int seconds = Mathf.RoundToInt(updatedSecond % 60f);
string formatedSeconds = seconds.ToString();
if (seconds == 60)
{
seconds = 0;
minutes += 1;
}
}