It is my understanding that LocalTick increases linearly on the client and server. Shouldn't TicksToTime on a PreciseTick constructed using local tick always increase linearly? I logged the result of the above code on my server and got the results seen in the attached image. As you can see, this time does not increase linearly.
#TimeManager.TicksToTime(TimeManager.GetPreciseTick(TickType.LocalTick)) is not linear!
11 messages · Page 1 of 1 (latest)
@undone kayak it should always be incremental for localtick.
@scarlet valve Could you possibly try logging the line of code that I put in my title? To me, it doesn’t appear to be incremental. Perhaps there is a bug in the
Time Manager? LocalTick is always incremental, I was able to confirm that. But there’s something weird going on when you get a PreciseTick using LocalTick, and then covert it to a time. You would think the time would increment linearly, but it doesn’t appear to.
That is interesting then... it could be rounding
although I guess that doesnt make sense because that would also be linear
Can you file a bug report please.
@scarlet valve https://github.com/FirstGearGames/FishNet/issues/569
GitHub
General Unity version: 2022.3.11f Fish-Networking version: 3.11.13R Discord link: https://discord.com/channels/424284635074134018/1181725555771576340 Description When generating a PreciseTick using...
ty
Good find!
Incorrect method
public double TicksToTime(PreciseTick pt)
{
double tickTime = TicksToTime(pt.Tick);
double percentTime = (pt.Percent * TickDelta);
return (tickTime + percentTime);
}```
Correct method
public double TicksToTime(PreciseTick pt)
{
double tickTime = TicksToTime(pt.Tick);
double percentTime = ((pt.Percent / 100) * TickDelta);
return (tickTime + percentTime);
}```
Awesome, thank you! Yeah, I thought that might have been the issue after debugging it further.