Character AI
A unity package to make your NPC lively by having their personality
For a more detailed guide, click here
Quick Start Guide


Download the unity package, expand the zip file and drop it into the assets folder.

The Unity package folder contains all the necessary files and prefab to bring your NPC to life.
There is a 3 step process to make the NPC alive.
Step 1: Drag and drop the PlayerInteraction preab as a child of the player GameObject. Define the name of player in PlayerTraits script. As well as OpenAI key in the conversationController script
Step 2: Add NPCtraits script to all the NPC GameObject. All the fields such as name, personality, backstory, age, friends, enemy, mood can be used to define an intricate NPC as per your liking which you want to come to life and see in action.
Step 3: Drag and drop the NPC gameobject with which you want to have a conversation with in the playerTraits script in the NPC variable. This script is present in the playerinteraction prefab which was added as a child to player gameobject previously.


The NPC can talk back to the player in 2 ways:
1. Reactive - Talks back the player based on his character

2. Proactive - Starts the conversation
Describe what you want with the generate command, wait a few seconds and voila! You will find the item you imagined with custom textures and enchatment in your inventory.

Press the trigger key (by default T) for NPC to start the conversation, based on character and memory.

Press and Hold Record key (by default R) to talk to NPC, release when you are done.

Use Cases

Instead of simply dragging and dropping the NPC into the player traits, NPC can be assigned through code as well for different cases, such as:
1. When player collides with NPC, the NPC variable in playerTraits can be set to the collided NPC (npcTraits script)
2. When NPC comes under a given radius of player
3. Specific NPC set on trigger such as for giving quest in some spaces

Need help? Suggestions? Feedback?