I have a rigidbody2D that is meant to rotate. When i press the pause button the timescale is set to 0.0f and everything stops like it is supposed to. But when I unpause the game and timescale goes back to 1, all the objects that should be rotating speed up really fast and then go back to their normal speed after a second. I have also noticed that the longer the game is paused and then unpaused the objects spin much faster.
Rotation
public float torque;
void Update () {
rb.AddTorque(torque, ForceMode2D.Force);
}
Pause
public void Pause()
{
if(isPaused == false){
Time.timeScale = 0.0f;
isPaused = true;
}else if(isPaused == true){
Time.timeScale = 1.0f;
isPaused = false;
}
}
Can someone please help me fix this so that when the game is unpaused, the objects are rotating at the same speed as they were before the pause.