Hi,
I am using unity and the narration manager
I have 3 sections , each is a question.
how can i get the users answer (as text) after each section end ?
I see the “On Selection Start” and On Selection End" but how do i actually get the users reply ?
Thank you!
Hello @Roy_Livne,
Welcome to the Convai Developer Forum!
I’m sorry, I didn’t quite understand your question. Could you elaborate on your question?
Have you followed this video and documentation?
Let us know if you still have questions after reviewing these resources, and we’ll be happy to assist!
Hi @K3
Thanks
Yeah i saw it.
No, not what i need…
The user talks to the npc right?
Can i get the conversation string of the user?
For instance:
The npc asks a question, than the user (me, you, anyone) answers.
Can i get that answer from the code? During runtime? The text?
I need to use the text
Thanks for the quick reply!
בתאריך יום ב׳, 13 בינו׳ 2025, 17:40, מאת Kaan via Convai Developer Forum <notifications@convai.discoursemail.com>:
Yes, you can get the user’s Speech Input during runtime.
In the ConvaiGRPCAPI.cs
file, locate the ProcessUserQuery
method. Inside the if(result.UserQuery.IsFinal)
statement, you can access the user’s input text using result.UserQuery.TextData
.
For clarity, I’ve attached a screenshot below to show exactly where this can be found. Let me know if you have any further questions!
Great! thanks for the help!
How can i access this script from the NPC ? is there a way ?
I have a gameobject in the scene that if i could just access it in the ConvaiGRPCAPI.cs
file or the other way around (from the Game object), i could fill an array with the replies
From the ProcessUserQuery
method, you can access the active NPC using the _activeConvaiNPC
variable. Through this, you can transfer the user’s text to the NPC or interact with it directly.
Alternatively, you can create a custom Event that triggers whenever a new user reply is processed, allowing you to handle responses dynamically.
The exact implementation depends on your project’s structure and requirements, so feel free to customize it accordingly. Let us know if you need further guidance!
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.