I'm trying to simulate physics manualy in a Unity 3D game. I've turned off Physics "Auto Simulation" in Project Settings and wrote this piece of code (it is more or less the [unity doc sample][1])

    private void Update()
    {
        this.timer += Time.deltaTime;
        while (this.timer >= Time.fixedDeltaTime)
        {
            this.timer -= Time.fixedDeltaTime;

            controller.ApplyForces(controls);
            Physics.Simulate(Time.fixedDeltaTime);
        }
    }

But when I play the game, movements are lagging a lot.  
In fact, I can explain it: my game runs at 120 fps. The `Time.fixedDeltaTime` is set to 0.01667 (60fps). So 1 out of 2 frames are not simulating physics! In other words, half of my Update calls don't enter the `while` loop, which produce the jump effect.

I'm sure i'm missing something... what is the recommended way to do this? Should I call `Physics.Simulate` in `FixedUpdate`?

EDIT:

As someone asked me in the comments (then deleted the comment), I'm simulating Physics manually for networking reason. With manual physics, I can do predictions and corrections. [Here's a link that describes the problem][2]


  [1]: https://docs.unity3d.com/ScriptReference/Physics.Simulate.html
  [2]: https://codersblock.org/blog/client-side-prediction-in-unity-2018