So basically, i tried to make a slow down script for my player and the world and then the speed should return to normal speed, and it seems like it does for less than a second but then just continues to slow down. (also im a coding fetus)
using UnityEngine;
public class TImeManager : MonoBehaviour {
public float slowDownFactor = 0.05f;
public float slowDownLength = 1f;
void Update()
{
Time.timeScale += (1f / slowDownLength) * Time.unscaledDeltaTime;
Time.timeScale = Mathf.Clamp(Time.timeScale, 0f, 1f);
}
public void slowDown()
{
Time.timeScale = slowDownFactor;
Time.fixedDeltaTime = Time.timeScale * .02f;
}
}
if anymore context is needed just tell me sorry i dont know much