Importing Custom Characters
Follow these instructions to set up your imported character with Custom Model with Convai.
To import your custom characters into your Convai-powered Unity project, you will first need to bring your model into your project. The model needs at least two animations: one for Talking and one for Idle.
When you want to set up your custom character with Convai, you will need your character model and two animations: Idle and Talking.
Create an animator controller with the two animations that looks like this. You should also add a 'Talk' boolean to ensure that you can trigger the animation. Here is a YouTube tutorial on how to set up an animator controller. This is the bare minimum animator setup that you need to do.
The animator controller should look like this. This is the the in-box NPC Animator.
Add an animator component and the created animator controller to the component. NPC Animator is the name of the animator that ships out of the box with the plugin. You will want to replace this with your own animator.
The animator component with the in-box "NPC Animator"
Add a Capsule (or any other shape of choice) Collider and make it into a trigger by selecting the IsTrigger field.
Add an Audio Source component to the character.
The GameObject should look like this.
Finally, change the Tag of the Convai-powered NPC to "Character" so that it can work with the in-box Convai Player Character.
Change the tag from "Untagged" to "Character"
The next page gives a brief overview of the ConvaiNPC.cs script.
You will have to do this part of the setup for characters downloaded from the playground through the character downloader if you are using the Core version of the plugin.
Create a Canvas with two TextMeshPro GameObjects. One of these will be where the transcript appears as we speak and the other will be where the character's transcript appears.
Drag the User Transcript TextMeshPro (named User Text here) to the User Text field in the Convai GRPCAPI script present in the Camera component in the Convai Player Character.
Go to the camera component of the Convai Player Character.
Add the User Text TextMeshPro GameObject to the User Text field.
Drag the Character's Transcript TextMeshPro to the Character Text field in the Convai NPC script in the character that you added.
Add the Character Text TextMeshPro GameObject to the Character Text field.
This will set up the new Character and you can talk to it.