Page 1 of 1

How to Create Tutorial that Waits for Event

Posted: Mon Feb 06, 2017 8:41 am
by Tony Li
This post describes one way to create a tutorial conversation that waits for a key press. The Tutorial Example scene demonstrates a similar but slightly different approach.

The requirements for this tutorial conversation are:

1. At a specific dialogue entry, wait for the player to press the Left Arrow key.

2. Give the player the option to hide the dialogue panel by clicking a "Let Me Try" button.

Example Scene: TutorialHideDialogueExample_2017-02-05.unitypackage

Here's how I set it up:

1. First, I created two inactive buttons named "Left Arrow Button" and "Let Me Try Button":

Image

2. Left Arrow Button is positioned off screen and is invisible (the color's alpha is zero). It has a UI Button Key Trigger that listens for Left Arrow. When clicked, it runs a sequence that sends the message "LeftArrowPressed" to the sequencer:

Image

The sequence "None()->Message(LeftArrowPressed)" means do nothing ("None()"), and when you're done doing nothing send the message "LeftArrowPressed" to the sequencer.

3. Let Me Try Button isn't a response menu button. It's just a regular button. When clicked, it deactivates itself and the Dialogue Panel:

Image

4. The dialogue entry node has the Sequence show below:

Image

The first two lines activate the special buttons I created (Let Me Try Button and Left Arrow Button).

The last two lines wait for a sequencer message "LeftArrowPressed". When it receives this message, reactivates the Dialogue Panel (in case Let Me Try Button deactivated it) and deactivates Let Me Try Button.

Re: How to Create Tutorial that Waits for Event

Posted: Mon Feb 06, 2017 8:43 am
by Tony Li
The dev who inspired the post above also posted some details about their solution here.