I have a simple 2D game in Unity 2017.2 where the player has to jump obstacles, and to raise difficulty I want to increase the speed of the game, so **i am using a InvokeRepeating method to increase Time.timeScale peridiocally**, but when I do that, the 1st time the InvokeRepeating method starts right, but **after modifiying the timeScale, the following times that the the InvokeRepeating method is executed it goes much faster in each execution**. It is like it is not interpreting that 1 second is actually 1 second anymore, because the timeScale has been modify. I hope I explain myself right.
This is the code simplyfied: `
void Update() {
InvokeRepeating("GameTimeScale", 6f, 6f);
}
void GameTimeScale(){
Time.timeScale += 0.25f;
Debug.Log ("Ritmo incremental. TimeScale: " + Time.timeScale.ToString ());
}
Any idea? I did something wrong? I am kind of new with unity
↧