How to pause dialogue

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
dryuk
Posts: 7
Joined: Sun Dec 25, 2022 2:25 pm

How to pause dialogue

Post by dryuk »

Hello, it's possible to pause dialogue when they start?
For example, when I am in dialogue and want to start a mini-game, the dialogue should pause, so when the mini-game ends, the next record of dialogue should start.
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to pause dialogue

Post by Tony Li »

Hi,

Yes. One way is to use the WaitForMessage() sequencer command. For example, set a node's Sequence to:

Code: Select all

SetDialoguePanel(false); // Hide dialogue UI
SetActive(MyMinigame, true); // Set GameObject named MyMinigame active
WaitForMessage(MinigameDone) // Wait for minigame to send sequencer message "MinigameDone"
When the minigame is done, it should use the C# method Sequencer.Message("MinigameDone");

Then the next node's Sequence can be:

Code: Select all

SetDialoguePanel(true); // Show dialogue UI
{{default}} // And play Dialogue Manager's Default Sequence
Related, see: How To: Pause Dialogue In Pause Menu for instructions on how to tell the Dialogue System to ignore input while the minigame is playing.
dryuk
Posts: 7
Joined: Sun Dec 25, 2022 2:25 pm

Re: How to pause dialogue

Post by dryuk »

Thank you! It helped me a lot
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to pause dialogue

Post by Tony Li »

Glad to help!
Post Reply