Preview. The Unity package and the Godot addon are new; tell us what your game needs at [email protected].
- it listens through the player’s microphone (the server notices when the player stops talking),
- answers in its own voice from where it stands in the world (3D audio),
- moves its mouth with what it says (blend shape, jaw bone, or a 0..1 value for anything else),
- and calls your game’s functions when the conversation calls for it: sell an item, open a gate, start a quest. These are tool calls, set up as “actions”.
Install
- Unity
- Godot
Unity 2021.3 or newer, no other packages. Window > Package Manager > + > Add package from git URL:
Your first talking character
1
Add the agent
Unity: select the character, Add Component > Lokutor > Lokutor Agent.
Godot: add a LokutorAgent child node (put it at the head: the voice comes from there).
2
Paste your API key
From app.lokutor.com. Fine while prototyping; see Shipping before you release.
3
Describe the character
Write who it is in Persona, and pick a Voice (
F1-F5, M1-M5, or a voice from
Voices) and Language.4
Press Play and talk
The character greets the player and listens. Headphones recommended.
Let the character do things
Actions are game functions the character can call. Without code, wire them in the editor: Unity’s Game actions list (a name, when to use it, and an On Called event) or Godot’s Game Actions (LokutorAction: a name, when to use it, a target node and method). With arguments, register them in
code. The handler runs on the main thread and returns a sentence that tells the character what happened:
Events and control
Microphone and echo
- Always (default): the microphone is open; the server detects turns.
- Push to talk: hold a key or input action, or call
SetTalking(true)/set_talking(true)from your own input code. - Mute mic while speaking (on by default) sends silence while the character’s voice can still be heard, through the engine’s buffers and the room’s echo, so laptop speakers cannot make it answer itself. Turn it off when players wear headphones, so they can interrupt the character.
Shipping: keep the key on your server
An API key inside a game build can be extracted. For a release, let your backend trade the key for a short-lived ticket (POST /ws-ticket) and give the agent that:
Platforms
Examples
Thegodot/ folder is a Godot project: press
Play to talk to Brom, a blacksmith who sells you a sword through an action. Unity’s Package Manager
has a Talking blacksmith sample: add its script to an empty GameObject and press Play.