Page 1 of 1

Pause Menu to Pause Dialogue

Posted: Thu May 20, 2021 8:37 am
by cairnryan
Hi Tony,

Hope you're doing well. I've been trying to implement a pause menu using this tutorial https://www.pixelcrushers.com/phpbb/vie ... f=3&t=4345, however I've run into some issues with pausing dialogue and I'm not exactly sure where to implement my code.

Basically when I pause the game during a conversation, it skips the line of dialogue currently running and resumes on the next node when I hit resume. Or if I hit pause during a player response section, when I try to resume it just completely ends the conversation...which isn't ideal as I've set that as a trigger to load the next scene.

My current pause menu script is below.

Code: Select all

void Update()
    {
        if(Input.GetKeyDown(KeyCode.Escape))
        {
            if (GameIsPaused)
            {
                Resume();
            } else
            {
                Pause();
            }
        }
    }

public void Resume()
    {
    pauseMenuUI.SetActive(false);
    Time.timeScale = 1f;
    GameIsPaused = false;
    }

public void Pause()
    {
    pauseMenuUI.SetActive(true);
    Time.timeScale = 0f;
    GameIsPaused = true;
    }
Other settings are set to Gameplay. Would adding PixelCrushers.DialogueManager.Unpause() to the Resume void, and PixelCrushers.DialogueManager.Pause() to the Pause void be appropriate? However, when I try I get this error:
Image

Hope this is somewhat clear, I'm just not exactly sure what's making those specific issues happen at those points when I pause/resume right now, and I'm not savvy enough to get my head around the pause and unpause functions. Any light you could throw my way would be greatly appreciated!

Using 2019.4.19 and Dialogue System 2.2.15.

Re: Pause Menu to Pause Dialogue

Posted: Thu May 20, 2021 10:53 am
by Tony Li
Hi,

I fixed a couple of typos in the post you cited. "PixelCrushers.DialogueManager" should be "PixelCrushers.DialogueSystem.DialogueManager".

Inspect your Dialogue Manager GameObject's Display Settings > Input Settings section. Set Cancel Subtitle Input > Key to None and Cancel Conversation Input > Key to None.

Re: Pause Menu to Pause Dialogue

Posted: Thu May 20, 2021 12:10 pm
by cairnryan
Cheers Tony, that works like a charm. Thanks especially for the heads up about the input settings, I'm learning something new all the time. Have a great day!

Re: Pause Menu to Pause Dialogue

Posted: Thu May 20, 2021 3:03 pm
by Tony Li
Glad to help!