Unity Plugin Beta Narrative Design - Speak Tags

When I set up narrative design, the character does not say the exact list words i set in the speak tags. I’m using v4.2.0 in unity from the Asset store.

How do I set my AI to speak a specific word or sentence in Convai Narrative Design? - tried this, but the speak tag isnt spoken. The opening line is always something random based on the character’s description.

Could you please share the Character ID, and make sure the character is not set to private.

Yes, here’s the Character ID 43432846-4df2-11f1-9468-42010a7be02e.

I tested your character. It works. How do you use speak tags?

The character works. I want the opening line and clsing line to be what I have set in the narrative design sections.

Opening section has:

In speak tags: Hi, I’m Mira. Let’s find you something good to watch tonight. How are you feeling - do you want something light, or are you up for something that pulls you in a bit more?

And closing section has:

Close the conversation now.

In speak tags: Sounds like tonight you want something you can actually sink into - not too heavy, but not nothing either. I hope you find exactly that. Enjoy. Do not mention time, timer, Unity, trigger, system, transcript, model, prompt, generation, or any technical process.Do not include stage directions, narration, pause cues, or breath cues.

However, the opening lines and closing lines the characters says are always different.

How do you use speak tags in Unity? Please show me your implementation.

Here is a snippet of my opening section:

Could you please show me your Unity side implementation?

On Unity side,

I have Convai Character Object with the following components: Convai Character, Audio Source, Convai Audio output, Narrative Design Manager, StartConvaiWelcomeTrigger.cs, ConversationTimer.cs.

Convai Character Obejct also has Opening Trigger and Timer End Trigger child objects with Convai Narrative Design Trigger components each for the respective triggers. This is the StartConvaiWelcomeTrigger.cs:

public class StartConvaiWelcomeTrigger : MonoBehaviour 

{

[SerializeField] private ConvaiCharacter convaiCharacter;
[SerializeField] private ConvaiNarrativeDesignTrigger welcomeTrigger;

private bool invoked;

private void Awake()
{
    if (convaiCharacter == null)
        convaiCharacter = GetComponent<ConvaiCharacter>();
}

private void OnEnable()
{
    if (convaiCharacter != null)
        convaiCharacter.OnCharacterReady += HandleCharacterReady;
}

private void OnDisable()
{
    if (convaiCharacter != null)
        convaiCharacter.OnCharacterReady -= HandleCharacterReady;
}

private void Start()
{
    if (convaiCharacter != null && convaiCharacter.IsInConversation)
        InvokeWelcomeTrigger();
}

private void HandleCharacterReady()
{
    InvokeWelcomeTrigger();
}

private void InvokeWelcomeTrigger()
{
    if (invoked)
        return;

    if (welcomeTrigger == null)
    {
        Debug.LogError("[StartConvaiWelcomeTrigger] Welcome trigger is not assigned.");
        return;
    }

    if (convaiCharacter == null || !convaiCharacter.IsInConversation)
    {
        Debug.LogWarning("[StartConvaiWelcomeTrigger] Character is not in conversation yet.");
        return;
    }

    invoked = true;

    bool success = welcomeTrigger.InvokeTrigger();
    Debug.Log("[StartConvaiWelcomeTrigger] Welcome trigger invoked: " + success);
}
}

I have the same issue when I test on Convai playground as well.

Please make sure you are using our latest update and follow the documentation, then try again:

https://docs.convai.com/api-docs/plugins-and-integrations/convai-unity-sdk/features/narrative-design

We tested it on our side, and it is working as expected.

If the issue continues, please try creating a new character and testing it again. Let us know the result.

I will try creating a new character as the current one does not work. Additionally, could it be an issue if the new playground as well as the legacy playground is used itnerchangeably for the same character?

No, it doesn’t make a difference.

The legacy playground has lower word limits in comparison to the new playground. So when narrative design is being used in the legacy playground, can we use the word limits of the new playground for core description etc? Or should we stick to the legacy playground word limits?

I created a new character. And the issue still persists. It does not say the exact line enclosed in the speak tags of the opening section.

I noticed that the section activates (OnSectionStart fires, trigger logs success) but Unity logs BT Code: None. I called the get-section API: the objective is stored correctly with the <speak> tag, but behavior_tree_code and bt_constants are both empty. Re-saving the graph and “Sync with Backend” doesn’t populate them.

Why isn’t this section compiling a behavior_tree_code server-side, and how do I force it to compile?

Could you please try this?

I tried the above as follows, still no luck:

I subscribed to the narrative events from code and logged the behavior tree payload on each section change:

private void HandleSectionData(NarrativeSectionData data) => Debug.Log($“Section {data.SectionId} BTCode length: {data.BehaviorTreeCode?.Length ?? 0}”);

Then I fired the opening trigger:

bool ok = character.NarrativeDesign.InvokeTrigger(“Opening Trigger”);
Debug.Log($“Opening trigger sent: {ok}”);

The trigger sends successfully (sent: True), and FetchTriggerAsync() confirms the trigger name and that its destination is the correct Opening Section. But OnSectionChanged never fires, the speak line is never spoken, and the decision transition to the next section never happens. When a NarrativeSectionData does arrive, BehaviourTreeCode.Length is 0. The get-section API also returns empty behaviour_tree_code and bt_constants, even though the section objective (with the speak tag) is stored correctly. Re-saving the graph and “Sync with Backend” don’t populate it.

So it looks like the sections aren’t compiling a behavior tree on the backend. Which would be why both the speak tags and the decision transitions do nothing in Unity. Is there something on my end that prevents the behavior tree from compiling, or is this backend-side?