Pause Menu to Pause Dialogue

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
cairnryan
Posts: 7
Joined: Sat Jan 30, 2021 11:52 am

Pause Menu to Pause Dialogue

Post 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.
Attachments
Screen Shot 2021-05-20 at 12.36.00.png
Screen Shot 2021-05-20 at 12.36.00.png (28.61 KiB) Viewed 499 times
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pause Menu to Pause Dialogue

Post 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.
cairnryan
Posts: 7
Joined: Sat Jan 30, 2021 11:52 am

Re: Pause Menu to Pause Dialogue

Post 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!
User avatar
Tony Li
Posts: 22037
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pause Menu to Pause Dialogue

Post by Tony Li »

Glad to help!
Post Reply