How to Send a Text?

Hello, I am creating content using your API.
What I want to do is create a widget UI in Unreal,
and pass the selected sentence to convAI as text.

It’s like selecting one of the user’s lines in the dialogue window between the user and NPC in an RPG game.

So, I first created UMG,
and wrote Blueprint code to execute the SendText function in ConvAIBasePlayer when the button is pressed.

However, when I run the code as shown in the photo,
I get a Blueprint Runtime Error: “Accessed None trying to read property Chatbot”. Node: SendText Graph: EventGraph Function: Execute Ubergraph WBP MMCA Blueprint: WBP_MMCA

It says it can’t connect to the chatbot.

But the strange thing is,

the part above where I said “Question by Voice” is code I wrote to speak while pressing the button, and that works normally.
It references the same Chatbot component.

Is there a solution?

Hello @thanatos78,

Welcome to the Convai Developer Forum!

How do you set the ChatBot variable?

When I first created the voice function, I simply used the StartTalking and Stop Talking events as shown in the figure above.
At that time, I had to attach a chatbot, but it worked normally even if it was empty, or I upgraded it to a variable and used it.

Similarly, using the SendText function or Send Text Dispatcher Event will cause an error.

Server logged in
Play in editor total start time 0.201 seconds.
Mobility of /Game/00_Curator/UEDPIE_0_LV_MMCA.LV_MMCA:PersistentLevel.BP_ViewerPawn_C_1 : CollisionCylinder has to be ‘Movable’ if you’d like to move it with CharacterMovementComponent.
Blueprint Runtime Error: “Accessed None trying to read property Chatbot”. Node: SetMainCharacter Graph: F_UpdateMainCharacterInEnvironment Function: F Update Main Character in Environment Blueprint: ConvaiBasePlayer
Blueprint Runtime Error: “Accessed None”. Node: SetMainCharacter Graph: F_UpdateMainCharacterInEnvironment Function: F Update Main Character in Environment Blueprint: ConvaiBasePlayer
Blueprint Runtime Error: “Accessed None trying to read property Chatbot”. Node: SendText Graph: Type Text Function: Execute Ubergraph Convai Base Player Blueprint: ConvaiBasePlayer
Blueprint Runtime Error: “Accessed None trying to read property K2Node_CustomEvent_Character”. Node: Assign On Text Received Graph: BindCharacterEvents Function: Execute Ubergraph Convai Base Player Blueprint: ConvaiBasePlayer
Blueprint Runtime Error: “Accessed None trying to read property K2Node_CustomEvent_Character”. Node: Assign On Transcription Received Graph: BindCharacterEvents Function: Execute Ubergraph Convai Base Player Blueprint: ConvaiBasePlayer
Blueprint Runtime Error: “Accessed None trying to read property K2Node_CustomEvent_Character”. Node: Assign On Failure Graph: BindCharacterEvents Function: Execute Ubergraph Convai Base Player Blueprint: ConvaiBasePlayer
Blueprint Runtime Error: “Accessed None trying to read property Chatbot”. Node: SendText Graph: EventGraph Function: Execute Ubergraph WBP MMCA Blueprint: WBP_MMCA

How do you set the chatbot variable?

I didn’t set anything special when setting the chatbot variable.

If Chatbot is null, how will it work? You need to set the Chatbot component.

1 Like

If I set the variables incorrectly, it won’t be possible to call the chatbot from outside.

However, the problem is that
even when sending text messages as custom events directly within the basic

convaibasePlayer code provided by you, the same error occurs.


Again, you are not setting the chatbot variable. Try this.

1 Like

If I set the variables incorrectly, it won’t be possible to call the chatbot from outside.

However, the problem is that
even when sending text messages as custom events directly within the basic

convaibasePlayer code provided by you, the same error occurs.


Hi @thanatos78 ,

It appears the the chatbot variable is null, you will need to set it to the character’s chatbot component, one way is using the Convai Get Looked at Character that @K3 shared, another is to use the function anmed `Convai Get All Chatbot Components` which will return an array of chatbot components, if you have only 1 character in then scene then picking up the first element of the array would be sufficent.