Dialogue Trigger

A dialogue trigger communicates messages to the player when they enter the area.

  1. Setup a project and scripts folder
    1. In Project, Create a new folder
    2. Name it _PROJECT and hit return
    3. Create a new folder inside _PROJECT
    4. Name it Scripts and hit return
  2. Create a script
    1. In Scripts, right-click and Create C# Script
    2. Name it Dialogue and hit return
    3. Past the code in and save it http://pastebin.com/C4em8twF
  3. Create the text
    1. Create UI / Text
    2. Rename it MessageText
  4. Create a trigger
    1. Create 3d Object / Cube
    2. Make its collider a trigger
    3. Rename it dialogue trigger
    4. Drag Dialogue script onto it or Add Component / Dialogue
    5. Type a message into the Message variable input box in the inspector
  5. Test it by hitting play and entering the cube to see the message appear
  6. If it works, click the dialogue trigger cube
  7. Uncheck the box for its Renderer to disable it and hide it.

Place it where you want it, you can turn its renderer on when you’re repositioning it to see it better.

Next Steps

This dialogue is very simple as it doesn’t give the player the ability to respond or have multiple lines of dialogue. For that, it is better to use a dialogue framework:

  • Dialogue Generator
  • Fungus with FungusTrigger
  • DialogueInstance
  • Dialogue System

Dialogue Generator

Dialogue Generator is a free and open-source more advanced C# script that adds multiple choices. It lacks a flowchart authoring mode, which Fungus has, but it has the advantage of being native C# script.

Fungus

Fungus is a free and open-source dialogue and narrative system for Unity that includes a flowchart authoring environment, a rich scripting system of visual blocks that require no C# knowledge, Lua scripting with variables, and a wide variety of example scenes demonstrating visual novel-style games.

FungusTrigger is a script that will let you use Fungus in combination with your 2D or 3D game’s character exploring the world.

Dialogue System

Dialogue System is the full-blown way to create professional game dialogue. It is best used in combination with Articy Draft.

Articy Draft

Articy Draft is a narrative design tool that now has a Unity plugin to bring dialogue and point-and-click adventure location navigation directly into Unity as playable scenes.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s