LogoLogo
PlaygroundVideosBlogPricing
  • Welcome
  • Convai Playground
    • Playground Walkthrough
    • Get Started
    • Character Creator Tool
      • Create Character
      • Language and Speech
      • Knowledge Bank
      • Personality and Style
      • State of Mind
      • Memory
      • Actions
      • Narrative Design
      • Character Versioning
    • F.A.Q
  • Plugins & Integrations
    • Introduction
    • Unity Plugin
      • Pre-Requisites
      • Compatibility
      • Downloads
        • Limitations of WebGL Plugin
      • Setting Up Unity Plugin
      • Troubleshooting Guide
        • Disable Assembly Validation
        • Missing Newtonsoft Json
        • Microphone Permission Issues
        • Default Animations Incompatibility
        • Animations have Facial Blendshapes
        • Jaw Bone in Avatar is not Free
        • macOS Permission Issues
      • Creating a Convai Powered Scene from Template
      • Importing Ready Player Me (RPM) Characters
      • Importing Custom Characters
      • Adding Actions to your Character
      • Adding Lip-Sync to your Character
      • Adding Narrative Design to your Character
        • Narrative Design Keys
      • Adding NPC to NPC Conversation
      • Adding Scene Reference and Point-At Crosshairs
      • Utilities
        • Character Emotion
        • Player Data Container
        • Long Term Memory
        • Language Support
        • Managing sessionID Locally
        • Transcript UI System
        • Pre-built UI Prefabs
        • Input Management
        • Notification System
        • Settings Panel
        • Dynamic Information Context
      • Building For Supported Platforms
        • Building for iOS/iPadOS
        • Building for WebGL
        • Convai XR
          • Building for VR
            • VR Automatic Installation
            • VR Manual Installation
          • Building for MR
            • MR Automatic Installation
            • MR Manual Installation
          • Building for AR
          • Interacting with XR UI Elements
        • Building for macOS Universal apps
      • Changelogs
      • Tutorials
        • Narrative Design
        • NPC2NPC
    • Unreal Engine
      • Supported Platforms
      • Installation
      • Guides
        • Dynamic Environment Info
        • Change AI Character Movement Speed
        • Integration with Pixel Streaming
        • Adjust Interaction Radius
        • Creating MetaHuman Characters
          • Adding MetaHuman
          • Adding LipSync to MetaHuman (From plugin version 3.0.0 or later )
          • Change the Parent Class for MetaHuman
          • Change the parent class for Player.
          • Adding LipSync to MetaHuman (Deprecated)
        • Creating ReadyPlayerMe Characters
          • Download Plugins
          • Adding ReadyPlayerMe Character
          • Change the parent class for Player.
        • Creating Reallusion Characters
          • Creating a Reallusion Character
          • Importing Reallusion character and setting up the Convai plugin
          • Binding objects to Reallusion Character
        • Event-Aware Convai Characters
        • Operations Based on the Presence of Certain Words
        • Narrative Design
          • Narrative Design Trigger
          • Narrative Design Keys
        • Actions Guide
          • Stage 1: Default Actions
            • Moves To
            • Follows
          • Stage 2: Custom Actions
            • Simple actions
            • Adding Descriptions to Actions
          • Stage 3: Custom Actions with Single Parameter
          • Main Character and Attention Object
        • Customization
          • Push to Talk
          • Alter Character Response Audio Rate
        • Speech To Text Transcription
        • Enable Multiplayer Support
        • 3D Chat Widget
        • Long Term Memory
        • Saving and Loading Session
      • Blueprints Reference
        • Convai Player
        • Convai Chatbot
        • Convai Environment
        • Convai Object Entry
        • Convai Result Action
        • Convai Extra Params
        • Speech To Text
        • Text To Speech
        • Utility Functions
      • Troubleshoot Guide
        • Missing Unreal Engine Tool Set in Microsoft Visual Studio Toolchain
        • Convai Module Not Found
        • MetaHuman Plugin Conflict
        • Failure to Load Character IDs
      • Microphone Settings
        • Set Audio Gain
        • Set Microphone
        • Microphone test
        • List Microphone Devices
      • Mac Microphone Permission: Required for UE 5.0 and 5.3
      • Guides V2 (Under Development)
        • Getting Started
          • Installation
          • Simple Talking Cube
          • Adding Premade Chat and Settings UI
    • Web Plugin
      • PlayCanvas Plugin
        • Adding External Script
        • First Person View
        • Adding characters to scene
        • Character Animations
        • Convai Integration
        • Chat Overlay
      • Convai Web SDK
        • Getting Started
        • Facial Expressions
        • Actions
      • JavaScript Chat UI SDK
        • Getting Started
        • ChatBubble Props
      • Narrative Design Guide
        • Narrative Design Triggers
        • Narrative Design Keys
      • GLB Characters for Convai
      • GLB/FBX animations for Convai
    • Modding Framework
      • Modding Cyberpunk 2077
    • Other Integrations
      • Roblox
        • Sample Game 1
        • Sample Game 2
        • Code Example
          • Character Conversation API
      • Discord
        • Create a Discord Bot
        • Hosting Discord Bot from Personal Server
        • Hosting Discord Bot from Replit
      • Omniverse Extension
      • Third-Party API Integrations
        • ElevenLabs API Integration
  • Reference
    • Core API Reference
      • Character Base API
      • Interaction API
      • Core AI Setting API
      • Backstory API
      • Chat History API
      • Knowledge Bank API
      • Narrative Design API
      • Action API
      • Language List API
      • Voice List API
      • Character List API
      • Evaluation API
Powered by GitBook
On this page
  • Convai Playground
  • Step 1: Select your Character in which you want to enable Narrative Design
  • Step 2: Open Narrative Design in Convai Playground
  • Unity Setup
  • Step 1: Add the Narrative Design Manager Component
  • Step 2: Setup the Narrative Design Component
  • Getting to know the Narrative Design Component
  • Getting to know about Section Triggers
  • Invoke Trigger from any script

Was this helpful?

  1. Plugins & Integrations
  2. Unity Plugin

Adding Narrative Design to your Character

Follow this guide to incorporate Narrative Design into your Convai-powered characters. Follow this step-by-step tutorial, open your project, and let's begin!

PreviousAdding Lip-Sync to your CharacterNextNarrative Design Keys

Last updated 3 months ago

Was this helpful?

Convai Playground

Step 1: Select your Character in which you want to enable Narrative Design

For this demo, we are using Seraphine Whisperwind, you can select whatever character you want to enable Narrative Design.

Step 2: Open Narrative Design in Convai Playground

Select the Narrative Design option from the side panel and create your narrative design

For this sample we have created the following Narrative design

You are all set to bring your character from Convai Playground to Unity, let's hope over to Unity to continue the guide

Unity Setup

Step 1: Add the Narrative Design Manager Component

Using Add Components Button in Convai NPC (Recommended Way)

1: Select your Convai Character in the scene and look for ConvaiNPC component in the inspector panel. Click on Add Components button

2: Select Narrative Design Manager checkbox and then click on Apply Changes button

Using Unity Inspector

1: Select your Convai Character and find Add Component button in the inspector panel

2: Search for Narrative Design Manager in the search box and select it

Step 2: Setup the Narrative Design Component

After adding the Narrative Design Component, you will be able to be the following component

This component system assumes that API key is setup correctly, so ensure that API key is setup correctly otherwise an error will be thrown.

After adding, component will retrieve the sections for the character ID taken from the ConvaiNPC, please wait for some time depending upon your network speed

The following section events are for character used in demo, and you will see section events corresponding to your character in which Narrative Design is enabled.

Getting to know the Narrative Design Component

Expanding the section event, you will see two unity events you can subscribe to, one is triggered when section starts, and another one is triggered when section ends

Getting to know about Section Triggers

Section triggers are a way to directly invoke a section in narrative design and can be used to jump to a different section in your narrative design

Step 1: Select the game object you want to make a trigger, in this example we have selected a simple cube, but it's up to your imagination.

Make sure that game object you have decided to be a trigger have a collider attach to it

Step 2: Add Narrative design Trigger from Add Component menu by searching for it

Step 3: Make the collider a trigger.

Step 4: Assign your Convai NPC to Convai NPC field

Now you can select from the "Trigger" dropdown which trigger should be invoked when player enters this trigger box.

We have added a way for you to manually invoke this trigger also, you can use InvokeSelectedTrigger function to invoke the trigger from any where

Invoke Trigger from any script

You can use this code block as a reference to invoke the trigger from anywhere

if(convaiNPC.TryGetComponent(out NarrativeDesignTrigger narrativeDesignTrigger))
{
    //Optional message parameter if you want to send some message while invoking
    //the trigger 
    string message = "Player has collected enough resources";
    narrativeDesignTrigger.InvokeSelectedTrigger(message);
}

For more information how to create narrative design in the please refer to the following YouTube video series

Convai Playground
Video series showing how to create Narrative Design
Screenshot showing selection of character in
Screenshot showing Icon of Narrative Design
Screenshot showing location of Add Components button in the Convai NPC inspector panel
Screenshot showing selection of Narrative design option in the Add Component Window
Screenshot showing location of Add Component button in the inspector panel
Screenshot showing which component to select from the search results
Screenshot showing a sample Narrative Design component
Screenshot showing various unity events user can subscribe to
Screenshot showing a game object with a collider selected
Screenshot showing selection of Narrative Design Trigger
Screenshot showing Box Collider becoming a trigger box
Screenshot showing assigning of Convai NPC to trigger component
Screenshot showing ability to select your desired trigger
Convai Playground