Setting up the Scene:

In every scene using Dialogue Bubbles there must be at least three objects

  1.  A player - a first or third person controller
  2. An NPC - any game object with a collider attached
  3. A Dialogue Bubbles Controller – A game object with the ‘DialogueControllerBubble’ script attached. Dialogue Bubbles Controller prefabs can be found in the ‘Prefabs’ folder.

To begin, import the latest version of Dialogue Bubbles to your project workspace in Unity. If you are starting a new project create a basic scene with a light, a plane, and either a first or third person controller. Next, drag either a round or square (depending on what type of bubble you want) ‘Dialogue Bubbles Controller’ onto the hierarchy from the Prefabs folder. Attach a ‘DialoguePlayer’ script to your first or third person controller and change the style variable of the script to match the controller type. Lastly, create at least one NPC to interact with. This can be any game object with a collider attached. Attach a ‘Dialogue’ script to this object and drag a dialogue text file (use Test.txt found in Demo/Dialogue for now) onto the ‘Text File’ box on the newly created NPC. Press play and test if the new scene works. By default, press ‘E’ to talk to the NPC.

Customise Bubble Appearance:

To customise the appearance of the bubble in Dialogue Bubbles first drag a Dialogue Bubbles Controller onto the hierarchy from the Prefabs folder. Rename this object and create a new prefab. This will allow for manipulation of the object without worrying about messing up the original prefab. Some ways to customise the bubble are as follows:

  • To change the shape of the bubble: Styles -> Background -> Normal -> Background. 
    • Remember to change Styles -> Backfound -> Overflow to match new bubble area.
  • To change the font of the text: Styles -> Text -> Font/Font Size. 
  • To change the selection highlight: Styles -> Text -> Focused ->Background/Text Color. 
    • To change text color only, use an invisible highlight (supplied). 
  • To change the max/min width and height set parameters in Dialogue Bubbles Controller. 
  • To enable sticky edges (so bubble stays on screen) tick parameter in Dialogue Bubbles Controller. 
  • To change bubble position use height offset (for target transform location) and position offset (for pixel offset).

Note: Some bubble and highlight shapes can be found in Dialogue Bubbles/Textures.