this is an error that has popped up from day dot of a project im working on, near finished also. but this error is constant, and i have not been able to figure it out yet.
but i have this script which slows down time and volume when the player dies. but when it reaches the bottom, it spews error messages, until i start the level again.
the errors are “Time.timeScale is out of range. Needs to be between 0 and 100. UnityEngine.Time:set_timeScale(Single)”
i just don’t know how to get rid of the errors. if anyone can help, that would be grand. script is at the bottom
public Canvas deathScreen
voidUpdate () {
if(GameObject.Find("Player") == false){
deathScreen.enabled = true;
if(Time.timeScale > 0){
Time.timeScale -= 0.01f;
}
if(GetComponent<AudioSource>().pitch > 0.0f){
GetComponent<AudioSource>().pitch -= 0.01f;
GetComponent<AudioSource>().volume -= 0.01f;
} else {
GetComponent<AudioSource>().Pause();
}
}
}