Match Timer - Per room

Hey everyone, kind of confused and probably over thinking this, but I cannot get the client to show a timer that is actively running and update every second. I have followed this video: https://www.youtube.com/watch?v=v5Ch701Poqg&t=275s
but even copying it exactly, the client deactivates the world timer prefab in scene and the timer text does not update. I have a room created, and joined, as well as the update bake and schema and a simulator attached.

Hey, I would take a look at how the time is synced.

First make sure that a value is being passed into the OnTimeUpdated function on the client. If you’re getting updates to this function then the problem is probably that you’re just not applying the update to the visible timer.

If you are not getting updates then you should make sure that you bake.

It is expected that the MatchTimer is deactivated on a client when simulating on server side, but the Text behaviour should still accept and render updates on the client.

Thank you so much for the reply and help! Here is the github with current code. Im syncing everything correctly according to video on unity side. Hopefully this will help narrow down what I am missing.

Are you seeing this when you inspect the instance that has the world timer?:

I am using your code and it is behaving strangely. Investigating.

So it looks like a bug. If I do Server Side with Client Input it works correctly. If I do just Server Side the instance is disabled with the above message and does not work. I’m going to create an issue for this. Try that and let me know if it helps.

Ahh I feel better knowing it wasn’t just me not understanding. Been on this for a week. Where can I get updates on this bug? Like when it will be resolved or at least updated so I can try again?

Ok, so. I got the code working based on the video but there’s a trick that is not explained. Also, the Server Side info popup and the message when it goes wrong are both very misleading so we’ll have to address this in an update (no promises on dates, sorry).

So the trick to get it to work if you don’t want to have Server Side with Client Input:

  • the simulator scene also has to have the WorldTimer prefab in the scene (the video example is using the same scene for the client and the simulator which is a nice convenience)
  • the WorldTimer prefab has to have the reference to the text to update as well. My initial test didn’t do this.

My scene looks like:

And when it is running you can see there are two WorldTimer instances in the hierarchy:

The disabled one is the one in the client’s scene and the one named [network] WorldTimer(Clone) is the one from the simulator and it is correctly updating the time, but the time comes from that prefab not my disabled one. You can see the same thing in the video:

I think what isn’t clear in the video is the relationship between the MatchTimer behaviour and the text renderer. They’re in the same prefab.

1 Like

Ok i was able to redo the scene from scratch and add your suggestions. I have ignored that server side popup and everything works. It is now server side only, runs with room just like in video.
Thank you so much for all of your help!