Quick Start Guide
Get a talking, listening NPC running in your Unity project. The QuickStart NPC is a capsule with a mouth box that opens with the loudness of its voice; the Shopkeeper and Kiosk scenes have no moving mouth. The three sample scenes draw in the Built-in Render Pipeline and in URP. HDRP is not supported.
The QuickStart folder also holds QuickStartHead.unity: the QuickStart setup with the sample head (Samples/Head/LocalNPC Head.prefab) in place of the capsule, and its own NPC to match the head: Corin of Hollowmere, a man, who speaks with the Microsoft David voice (or the default voice when David is not installed). The head opens its jaw with the loudness of the voice; other mouth shapes need the optional uLipSync package, and the head does not blink.
🚀 Setup
Step 1: Open the Setup Wizard
From the Unity menu bar, select:
Tools → LocalNPC → Setup Wizard
The wizard will verify your project settings (Unity version, 64-bit architecture). It has three tabs: 1. Environment & Hardware, 2. Model Provisioning and 3. Ready to Converse.
Step 2: Download the Balanced Preset Models
- In the Setup Wizard, tab 2. Model Provisioning, select Balanced Preset (Recommended), the default (1.20 GB of model files). On a low-end PC, select Fast Preset (low-end PCs) instead (569 MB).
- Click Download & Provision Balanced Suite (with Fast selected, the button says Download & Provision Fast Suite).
- The wizard downloads these files from Hugging Face (huggingface.co), over HTTPS with the server's certificate checked, and checks each one with SHA-256:
- LLM:
qwen2.5-1.5b-instruct-q4_k_m.gguf(1.12 GB; with Fast,qwen2.5-0.5b-instruct-q4_k_m.gguf, 491 MB) - STT:
ggml-tiny.en.bin(Whisper)
- LLM:
No voice activity model is downloaded: speech is detected by the built-in energy VAD. The voice needs no download. The NPC speaks with the Windows system voice (for en-US: Microsoft Mark first, then Microsoft Zira, then Microsoft David, then any other en-US voice, then a voice of another English region such as en-GB; SAPI 5 as the last fallback).
The same files can be downloaded one by one in Tools > LocalNPC > Model Manager. The speech-to-text model is the entry of the model catalogue shown there.
Step 3: Add an NPC to Your Scene
Create a 3D capsule character or character model:
GameObject → 3D Object → CapsuleAdd the
NpcAgentcomponent to the GameObject:Add Component → LocalNPC → NPC AgentAdd an
AudioSourceand aSpeechAudioQueueto the same GameObject, so the NPC can be heard:Add Component → Audio → Audio SourceThen click Add AudioQueue in the
NpcAgentInspector. These two components are not added automatically.Create or assign an
NpcPersonalityasset:- Right click in Project window:
Create → LocalNPC → Personality - Name it
CompanionPersonality. - Set Display Name:
Companion - Set System Prompt:
You are a helpful, witty companion traveling with the player. Keep replies to one or two sentences. - Set Greeting:
Hello there! Where are we heading next? - Drag
CompanionPersonalityinto the Personality field ofNpcAgent.
- Right click in Project window:
Step 4: Turn On Listening
- In the
NpcAgentInspector, under Lifecycle & Startup, tick Listen On Start (leave Prewarm On Start ticked). From code, callStartListening()afterPrewarmAsync()instead. - That is all the microphone setup.
NpcAgentstarts the microphone itself when it starts listening and stops it onStopListening(). Do not add aMicrophoneCaptureto another GameObject: two captures would record the same device. - In Windows, open Settings > Privacy & security > Microphone and allow desktop apps to use the microphone.
- Optional: add
SubtitleHud(from the samples; after you import the.unitypackageit is atAssets/LocalNPC/Samples/SubtitleHud.cs) to an empty GameObject for on-screen dialogue display.
If the microphone cannot be used, NpcAgent raises OnError with the code MicrophoneUnavailable and a message that says why. The agent stays in the Listening state. See the Troubleshooting Playbook.
Only one NpcAgent listens to the microphone at a time; a second one logs a warning and gets no voice input. While the NPC is speaking, the microphone is ignored.
Tip: In a noisy room or on loudspeakers, use a headset (the NPC's own voice can come back through the speakers).
Step 5: Press Play & Talk
- Click Play in the Unity Editor.
- Speak clearly into your microphone: "What can you help me with?"
- The NPC will transcribe your voice, generate a response using the local language model (1.5B with the default Balanced preset, 0.5B with Fast), and reply out loud through the AudioSource!
If Windows has no voice for the NPC's language, the NPC answers in text only and the Console shows one warning that says how to add a voice. See Troubleshooting.
Speech-to-text runs inside the Unity process, through the whisper.cpp 1.9.5 DLLs in the package. There is no separate program to install or start.
If the speech model or one of these DLLs cannot be loaded, NpcAgent raises OnError once. The message says what is wrong and what to do, and contains the sentence "Speech input is off. Text input still works." The NPC then goes to Idle and answers typed input as usual. A missing speech model is downloaded in Tools > LocalNPC > Model Manager. See the Troubleshooting Playbook.
💡 Testing Without a Microphone
If you don't have a microphone plugged in:
- Select your NPC GameObject in the Hierarchy during Play Mode.
- In the
NpcAgentInspector, locate the Test With Typed Input (No Microphone Required) box. - Type any question and click Send Prompt. The turn executes immediately with full audio and subtitles.