When you set 'Time.timeScale = 90', time will pass 90 times as fast. This means that Time.deltaTime will also be accelerated by 90x. So if it takes 1/3 of a second to skip the dialog, your worldTime will advance by 30 seconds. I see two possible fixes. First, you could change your letterPause variable to something small to cause the typing to go quickly rather than increasing Time.timeScale. Or you can save and restore worldTime. For the latter I mean something like:
function SkipDialogLineAction (){
if (dialogInteractions.currentState == DialogStates.ShowTextLine){
Time.timeScale = 90;
worldTimeSaved = worldTime;
}
}
if(currentState == DialogStates.Idle && Time.timeScale == 90){
Time.timeScale = 1;
worldTime = worldTimeSaved + 5.0;
}
↧