About how accurate is GetServerTimeNow?

I’m using GetServerTimeNow as a way to calculate projectiles to make it appear the same on different clients, would using GetServerTimeNow to calculate elapsed time make this work as I want it to?

Also, how much would the results of GetServerTimeNow vary on each client? Like a few milliseconds?

workspace:GetServerTimeNow() should be pretty accurate down to a few milliseconds.

Caveat, I’ve not used this, but when you ask how much getservertimenow will vary on clients, it is probably best to assume quite a bit: a 70ms ping client vs a 20ms ping client will see a 0.05 second round trip difference. For calculating projectile position, 0.05s variation could be significant. Laggy clients will cause obvious problems.

To follow up: yes you could work out the client ping and compensate for it, but you are heading into authorative server tech and I believe roblox are planning to roll out their own system near the end of the year… So perhaps just wait for that?

1 Like

I’ve used GetServerTimeNow hundreds of times in my projects, and it’s reliable enough for this kind of use case. There may be a few milliseconds of variation across clients, but the difference is so small it’s basically negligible

We’ve been using this for our powerup rewrite in TTT, and it’s been reliable. However, I’m curious as to why you need server time to create the projectile on clients when you could make the server do all physics and have the client only play the animation of a projectile going from A->B without any need for the server time.

You’re making the incorrect assumption here, that GetServerTimeNow doesn’t account for ping. Which it does. Otherwise there’d be no point to it.

And Roblox is at it’s core a platform of quick iteration and prototyping. It’s almost never a good idea to wait for certain features, when a whole game can be made in the time it’ll take those features to ship.

2 Likes

Thanks, I see it’s not even a live request How does workspace:GetServerTimeNow() work? Does it replicate time on every call or in the background? but a best guess.

Workspace | Documentation - Roblox Creator Hub is worth a read with a view to cost and accuracy.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.