How to prevent Navmesh Agent from overshooting destination with high Time.TimeScale?

I’ve noticed that if I increase the Time.TimeScale, the agent will overshoot its destination for a few frames (I’m assuming this happens since the Update() function runs less times per frame and so it lacks precision once the timeScale is increased.

To try and fix this, I’ve turned the agent updatePosition to false and I’m manually doing the:

transform.position = agent.nextPosition;

So my question is, what is the correct procedure to make sure that the calculations for the next transform.position are accurate, even with high Time.timeScale?

Finally figured it out. In case anyone else has the same issue, this is what worked in my case…

First step is to disable navMeshAgent updatePosition like I mentioned above. Then I manually move the agent based on my timescale by doing the following:

	if (Time.timeScale > 1.0f && agent.hasPath) {
		NavMeshHit hit;
		float maxAgentTravelDistance = Time.deltaTime * agent.speed;

		//If at the end of path, stop agent.
		if (
			agent.SamplePathPosition(NavMesh.AllAreas, maxAgentTravelDistance, out hit) ||
			agent.remainingDistance <= agent.stoppingDistance
		) {
			//Stop agent
		}
		//Else, move the actor and manually update the agent pos
		else {
			transform.position = hit.position;
			agent.nextPosition = transform.position;
		}
	}