Hello!
I'm having issues pausing dialogue sequences. If I use DialogueManagerInstance.Instance.Pause, it freezes the timescale as well. Is there a way to pause dialogue without affecting timescale? I thought it might have to do with my dialogue time mode being Gameplay but when I set it to Realtime nothing changed.
Thanks!
Pausing a conversation
Re: Pausing a conversation
Hi,
Setting Dialogue Time to Realtime should do it, as this won't freeze timescale. It will only stop the internal clock used by the Dialogue System (including sequencer commands). What isn't working?
Setting Dialogue Time to Realtime should do it, as this won't freeze timescale. It will only stop the internal clock used by the Dialogue System (including sequencer commands). What isn't working?
Re: Pausing a conversation
Hello!
The problem I'm facing is we need the dialogue time to be set to gameplay for this project. I've implemented a skip for cutscenes which is functional, but I would prefer that dialogue freeze before we fade out. If I attempt to change the dialogue time in code, it freezes the entire game even if I wait a frame before executing the pause. I've tried setting the dialogue time to realtime in the editor before playing and it gives the same problem. I know the issue is related to timescale sense I am able to press the pause button to unpause the game, at which point everything behaves normally, and if I set TimeScale to 1 after pausing the sequence, the game no longer freezes, but the pause is ignored.
The problem I'm facing is we need the dialogue time to be set to gameplay for this project. I've implemented a skip for cutscenes which is functional, but I would prefer that dialogue freeze before we fade out. If I attempt to change the dialogue time in code, it freezes the entire game even if I wait a frame before executing the pause. I've tried setting the dialogue time to realtime in the editor before playing and it gives the same problem. I know the issue is related to timescale sense I am able to press the pause button to unpause the game, at which point everything behaves normally, and if I set TimeScale to 1 after pausing the sequence, the game no longer freezes, but the pause is ignored.
Re: Pausing a conversation
Hi,
What's the reason for setting Dialogue Time to Gameplay?
Here are what the time modes mean:
What's the reason for setting Dialogue Time to Gameplay?
Here are what the time modes mean:
- Gameplay: Same as Time.timeScale. DialogueManager.Pause sets Time.timeScale=0.
- Realtime: Unrelated to Time.timeScale. Uses Time.unscaledDeltaTime, except if paused it returns 0 for delta time.
- Custom: You must manually set DialogueTime.time and DialogueTime.deltaTime every frame. The Dialogue System will use the values you set.
Code: Select all
float timeWhenPaused;
float totalTimePaused;
public void Pause()
{
timeWhenPaused = Time.time;
DialogueManager.Pause();
}
public void Unpause()
{
totalTimePaused += Time.time - timeWhenPaused;
DialogueManager.Unpause();
}
void Update()
{
if (DialogueTime.isPaused)
{
DialogueTime.time = timeWhenPaused;
DialogueTime.deltaTime = 0;
}
else
{
DialogueTime.time = Time.time - totalTimePaused;
DialogueTime.deltaTime = Time.deltaTime;
}
}