Neocortex Logo

Neocortex Unity SDK 0.8.0: Lip Sync and Quiz Hosts for AI NPCs

Unity SDK 0.8.0 catches up with our Godot and Unreal SDKs: lip sync on streamed voice, a quiz show sample, a samples launcher and errors you can act on.

Neocortex TeamThe team behind Neocortex

· 4 min read

Unity SDK 0.8.0 catches up with our Godot and Unreal SDKs: lip sync on streamed voice, a quiz show sample, a samples launcher and errors you can act on.

Unity SDK 0.8.0 is out. In November we released our Godot and Unreal SDKs, and this update brings Unity level with them: lip sync that keeps up with streamed voice, a quiz show sample, one scene that opens every sample, and errors your game can act on.

If you already use the Unity SDK, your characters and scenes keep working. Update the package and the new parts are there.

What's new in Unity SDK 0.8.0

  • Lip sync starts with each streamed line instead of after it.
  • A Quiz Show sample: Cora hosts a quiz for one to four players at one screen.
  • A 0 - Samples launcher scene that opens every sample with your own character.
  • Errors with a status, the API's code and checks such as IsRetryable().
  • StopSpeaking(), Abort() and OnUnhandledAction on the Smart Agent.
  • A delay between the actions of one reply.
  • The Apache 2.0 license, the same as our other SDKs.

Cora in the Unity Text Chat sample

Lip sync that keeps up with the voice

Characters start speaking while the rest of the reply is still on its way. Until now the mouth only moved once a streamed line had finished playing. NeocortexFaceAnimator now starts with each line as it is heard, rests while the voice pauses, and fits the words to the clip's real length when there is one.

The animator also follows a NeocortexQuizAgent, so a quiz host's mouth moves with its lines without any code of yours.

A quiz show for one to four players

The new 7 - Quiz Show Demo sample has Cora hosting a quiz from a question set you write in the dashboard. Up to four players share one screen: pick who answers with the Reply As chips, type an answer or tap an option, and use Hint, Pass, Pass Everyone, Abort and Resync. The question card shows progress, and the game ends with the final standings. Question order, retries, hints and scoring are decided on our side, so a question grades the same in your game as in the editor.

Quizzes need a Team plan.

One launcher for every sample

Open 0 - Samples and every sample is a card. Pick the character all of them use, the question set the quiz plays and the microphone once, and each sample opens with your choices. A Back to Samples button (or Escape) takes you back, and the group chat sample casts your other characters.

The samples are text chat, audio chat, actions, interactables, group chat, usage gating and the quiz show. For a build, right-click the Sample Launcher component and pick Add Samples To Build Settings.

Cora walking to shapes in the Unity Interactables sample

Errors you can act on

Every failed request now raises OnRequestError with a RequestError: the HTTP status, the API's error code, a message, and checks such as IsRetryable(), IsRateLimited() and IsUnauthorized(). It's on the Smart Agent, the Group Director, the Quiz Agent and the Usage Gate.

using Neocortex;
using Neocortex.Data;
using UnityEngine;

public class Guard : MonoBehaviour
{
    [SerializeField] private NeocortexSmartAgent agent;

    private void Start()
    {
        agent.delayBetweenActions = 0.5f;
        agent.OnRequestError.AddListener(OnError);
        agent.OnUnhandledAction.AddListener(a => Debug.Log($"No handler for {a.name}"));
    }

    private void OnError(RequestError error)
    {
        if (error.IsRateLimited()) ShowToast("Give me a second...");
        else if (!error.IsRetryable()) Debug.LogError($"{error.code}: {error.message}");
    }

    private void ShowToast(string text) { /* your UI */ }
}

Lookups, chat history, transcription and speech are retried once on their own when the error is temporary. Chat and quiz turns are never sent twice. When your workspace reaches its plan's limit, the editor and development builds tell you which plan fixes it and link to it. Release builds stay silent, so players never see it.

More control over a character

  • StopSpeaking() silences the character and drops anything queued, for when the player walks away mid-sentence.
  • Abort() also cancels the turn in flight, and a cancelled request no longer reports a failure.
  • OnUnhandledAction fires for an action with no handler, so a missing RegisterAction call shows up in testing.
  • delayBetweenActions puts a pause between the actions of one reply. 0 keeps them back to back.

How to update

In Unity, open Window > Package Manager, click +, choose Add package from git URL and paste:

https://github.com/neocortex-link/neocortex-unity-sdk.git

Add #0.8.0 to the end to pin this version. Unity copies samples into your project, so import them again from the Samples tab to get the launcher and the quiz show. The SDK needs Unity 6 (6000.0) or later.

New to the SDK? The Unity quick start goes from install to a talking character, and our tutorial on adding AI characters to Unity builds a full scene.

The SDK is on GitHub under Apache 2.0, and the full list of changes is in the changelog. Your characters also work in Godot, Unreal Engine and the web.

Tell us what your Unity game needs next on our Discord.

Frequently Asked Questions

What's new in the Neocortex Unity SDK 0.8.0?

Lip sync that starts with each streamed line, a quiz show sample for one to four players, a launcher scene for all samples, errors with status codes and retry checks, StopSpeaking and Abort on the Smart Agent, a delay between actions, and the Apache 2.0 license.

How do I update the Neocortex Unity SDK?

Open Package Manager and add the package again from https://github.com/neocortex-link/neocortex-unity-sdk.git, or add #0.8.0 to the URL to pin this version. Then import the samples again from the Samples tab, because Unity copies samples into your project.

Does the Unity SDK support lip sync?

Yes. NeocortexFaceAnimator moves ARKit-style mouth blend shapes as the character speaks. From 0.8.0 it starts with each line as it is heard, rests while the voice pauses, and follows quiz hosts too.

Can a Unity character host a quiz?

Yes. NeocortexQuizAgent runs a quiz from a question set you write in the dashboard, and the Quiz Show sample has Cora hosting it for one to four players at one screen. Quizzes need a Team plan.

Which Unity versions does the SDK support?

Unity 6 (6000.0) or later, on desktop, Android, iOS and WebGL.

Is the Neocortex Unity SDK open source?

Yes. It's on GitHub under the Apache 2.0 license. Versions before 0.8.0 were MIT.

Similar Posts