Hello, I recently upgraded my game to use netcode and as such I now use a fixed 60 fps tick rate when updating objects to make the game deterministic. The problem is now that there is a slight jitter with the cinemachine camera (It’s more noticeable if my player object is moving fast or if I change the tick rate to lower values.) I was wondering how can I go about fixing this? Setting the damp to 0 for x and y removes the jitter but now the camera is less fluid as the player is always centered. I was wondering if there is a way I can keep the damping but having it work with my fixed tick rate. Unfortunately I can’t use fixedupdate as it is not completely deterministic. If it helps, here is the basic code I use for the ticks. Essentially until 1/60th of a second has passed there is no movement on the player object.
void Update()
{
if(isLocalPlayer)
{
timerClient += Time.deltaTime;
while (timerClient >= MIN_TIME_BETWEEN_TICS) // MIN_TIME_BETWEEN_TICS = 1 / 60
{
timerClient -= MIN_TIME_BETWEEN_TICS;
HandleTickClient(); // Move player on client
currentTickClient++;
ResetTickVariablesClient();
}
}
if(isServer)
{
// Same code essentially as client to keep things deterministic
}
}