Links
Comment on page

Convai UI Prefabs

We provide several UI options to display character and user's transcript out of the box that players can use with the Convai Plugin. You can use and customize these prefabs.
The ConvaiNPC and ConvaiGRPCAPI scripts look for GameObjects with Convai Chat UI Handler as a component, and send any transcripts to the script so that it can be displayed on screen.

Types of UI

Subtitle

Prefab Name: Convai Transcript Canvas - Subtitle
The user and character transcripts are displayed in the bottom like subtitles.

Question-Answer

Prefab Name: Convai Transcript Canvas - QA
The user's transcript is displayed in the top where as the character's transcript is displayed in the bottom.

ChatBox

Prefab Name: Convai Transcript Canvas - Chat
Both the user's and the character's transcripts are displayed one after other in a scrollable chat box.

Android

Prefab Name: Convai Transcript Canvas - Android
Identical to Subtitle UI. Includes a button that can be pressed and held for the user to speak. Ideal for portrait orientation of screen.

Convai Chat UI Handler Component

Field
Function
Character Name
The name of the character that is currently speaking.
Character Text
The transcript of what the character is speaking.
Character Text Color
The color of the text or the speaker name when the transcript is displayed when the character is speaking.
User Name
The name of the user that is currently speaking.
User Text
The transcript of what the user is speaking.
User Text Color
The color of the text or the speaker name when the transcript is displayed when the user is speaking.
Is Character Talking
A flag that is true when the character is currently speaking.
Is User Talking
A flag that is true when the user is currently speaking.
User Text Field
Text mesh pro field for the user's transcript to be displayed.
Character Text Field
Text mesh pro field for the character's transcript to be displayed.
UI Type
The type of the UI that we are displaying.

Functions to Know

SendCharacterText
A public function that sends a string of text to be displayed as character transcript along with the name of the character who said it.
SendUserText
A public function that sends a string of text to be displayed as user transcript.