NarrativeDesign scripting error in Unity 6.3 with Convai SDK 4.1.0

What do you need help with?

Documentation / Learning Resource issue

Installation method

Unity Asset Store

Issue area

Other

Impact

Major - a core flow is broken

Unity version

unity 6.3

Convai Unity SDK version

4.1.0

Target platform

Unity Editor

Where does it happen?

Not applicable

Short summary

i am getting error in code for Narrativedesign scripting.

What happened?

I am getting error in attached screenshot you can see.

Screenshots, recording, logs, or minimal repro

I checked the relevant documentation, resources, and similar forum posts before posting.

on

I confirm that I did not include API keys, tokens, passwords, secrets, private character data, private conversation logs, or customer data.

on

What is the problem?

I’m getting compilation errors with the code from the screenshot I shared. The issue is that IConvaiNarrativeDesign and character.NarrativeDesign are not being recognized.

Can you show me the correct namespace, required references, and a working code snippet for accessing IConvaiNarrativeDesign and character.NarrativeDesign?

What are you trying to do?

simply i wanted to test your documentation code, but not working.

There is no issue with the documentation code.

From what I can see, this looks more related to your Unity / C# scripting knowledge. Your IDE setup may not be configured correctly, so the required namespaces and references are not being detected or added automatically.

Since this is more on the Unity/C# scripting side, I recommend using an AI assistant or reviewing basic Unity scripting setup to help resolve the IDE/reference issue.

I’m sharing a screenshot below showing that the code compiles correctly on my side, along with the working code for reference.

using Convai.Domain.Narrative;
using Convai.Runtime.Components;
using UnityEngine;

public class Test : MonoBehaviour
{
ConvaiCharacter character;
private void OnEnable()
{
character.NarrativeDesign.OnSectionChanged += HandleSectionChanged;
character.NarrativeDesign.OnSectionDataReceived += HandleSectionData;
}

private void OnDisable()
{
    character.NarrativeDesign.OnSectionChanged -= HandleSectionChanged;
    character.NarrativeDesign.OnSectionDataReceived -= HandleSectionData;
}

private void HandleSectionChanged(string previousId, string newId)
{
    Debug.Log($"Section: {previousId} → {newId}");
}

private void HandleSectionData(NarrativeSectionData data)
{
    Debug.Log($"Section ID: {data.SectionId}");
}

}

no, i am getting same compilation error, i am using plugin version is 4.1.0.

This is my code.

using UnityEngine;
using Convai.Runtime.Components;
using System.Collections;
using Convai.Domain.Narrative;

public class InterviewStarter : MonoBehaviour
{
[SerializeField] private ConvaiCharacter character;

private void OnEnable()
{
//IConvaiNarrativeDesign narrative = character.NarrativeDesign;
character.NarrativeDesign.OnSectionChanged += HandleSectionChanged;
character.NarrativeDesign.OnSectionDataReceived += HandleSectionData;
}

private void OnDisable()
{
//IConvaiNarrativeDesign narrative = character.NarrativeDesign;
character.NarrativeDesign.OnSectionChanged -= HandleSectionChanged;
character.NarrativeDesign.OnSectionDataReceived -= HandleSectionData;
}

private void HandleSectionChanged(string previousId, string newId)
{
Debug.Log($“Section: {previousId} → {newId}”);
}

private void HandleSectionData(NarrativeSectionData data)
{
Debug.Log($“Section ID: {data.SectionId}”);
// data.BehaviorTreeCode and data.BehaviorTreeConstants available here
}

Could you please share a screenshot of the code?

yes here it is.

Show me the error.

Please update to the latest version.

https://assetstore.unity.com/packages/tools/behavior-ai/npc-ai-engine-dialog-actions-voice-and-lipsync-convai-235621

i can not update from 4.1.0 to 4.2.0 using asset store. can you please guide me through?

What is the issue?

i have already added a package version 4.1.0 but when i click on open in unity in asset store that is not open latest version 4.2.0, it is open 4.1.0.

Please show me your package manager.

Please follow the package manager installation method.

[Package Manager Window] Error adding/removing packages: com.convai.convai-sdk-for-unity@4.2.0.
Unable to add packages:
Unable to add package [com.convai.convai-sdk-for-unity@4.2.0]:
Cannot download the package. Your account does not grant permission to use the package. Please visit the Asset Store to acquire the package and add it to your account:
Access to ‘https://download.packages.unity.com/com.convai.convai-sdk-for-unity/-/com.convai.convai-sdk-for-unity-4.2.0.tgz’ was denied
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

Getting this error.

This looks like an issue related to your Unity account permissions or Unity’s package access system.

As a workaround, I uploaded the Unity package to Google Drive. Please download it from there and import it into your project manually.